I have been working on this program for some time now, and i've stripped it down into smaller executables so i can test each individual part of my code (a lot of debugging to do)...anyhow, i have a part of it worked out finally, it works, sort of. It is supposed to create a file name logically by concatenating two c style strings...that all works, but the final output it strange...code like this:
when i run the program, it creates a file with the correct data in it, however the file extension is messed up, the last letter of the file extension (in this case being 'L') is replaces with '1/4A' i've tried with different file extensions and the same thing happens....does anyone know whats happening here? i thought perhaps it has something to do with the terminating character of the string...but i don't know. thanksCode:#include <iostream> #include <fstream> #include <stdio> using namespace std; char id[5]; char fileHandle[]=".xml"; char* fileName; int main() { cout<<"enter id"<<endl; cin>>id; fileName=strcat(id,fileHandle); //now open the file and create the fout object for writing ofstream fout(fileName); fout<<"ok"; fout.close(); return 0; }