how would you do the above, as it obviously doesn't work.Code:string name;
cin>>name;
ofstream name_file ( name );
Printable View
how would you do the above, as it obviously doesn't work.Code:string name;
cin>>name;
ofstream name_file ( name );
It's an oversight in the standard that the file streams can't take std::strings for the file name. It will be fixed in the next revision of the standard.Code:ofstream name_file(name.c_str());