For the following code; if I enter 'filename' as the filename, shouldn't this pass 'filename.txt.' to the ofstream? There MUST be an easier way to do this.. plus the fact it doesn't work.
Thanks.Code:
char filename[24];
cout<<"Filename for data output (max 20 characters)->";
cin.getline(filename, 20, '\n');
filename[20] = '.';
filename[21]='t';
filename[22]='x';
filename[23]='t';
ofstream logfile(filename, ios::out | ios::end );
logfile.seekp(ios::end);