Hello
I'm reading Prata's C++ Primer Plus 6th and I have a doubt about an example code for I/O.
On page 1117 there is a code that, among other things, says:
Code:string filename; cout << "Enter filename"; cin >> filename; ofstream fout(filename.c_str());
The books says c_str() is used to pass the name of the file, that is a string.
On page 1121 in a different example
Why don't they useCode:fin.open(argv[number]);in this case?Code:.c_str()