how would you do the above, as it obviously doesn't work.Code:string name; cin>>name; ofstream name_file ( name );
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());
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law