// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
#include <iostream>
#include <sstream>
#include <cstdio>
#include <string>

using namespace std;

int main()
{
    string fnm1 = "abc";
    fnm1 += ".dat";
    cout << fnm1.c_str() << endl;
    char fnm2[] = "abc";
    char tmp1[200];
    sprintf(tmp1,"%s.dat",fnm2);
    cout << tmp1 << endl;
    stringstream tmp2;
    tmp2 << fnm2 << ".dat";
    cout << tmp2.str().c_str() << endl;    
    return 0;
}
