I have run through this code many times, and i cant figure out what's wrong with it! why doesn't it work?? i have isolated it to just the following lines:
my thoughts are maybe something to do with the strcat? also how do i know i am not overrunning something??Code:fstream DataFile("data.txt", ios::in | ios::binary); if(!DataFile) { cout << "No file found!!!\n"; return 0; } else { char* data; data = new char; char tmp; while(DataFile.get(tmp)) strcat(data, &tmp); cout << data << endl; delete data; return 0; }



LinkBack URL
About LinkBacks


