I was wondering if there was a way to open user-specified files in c++ (like user types in file name, program opens that file) as illustrated below
#include "apstring.h" //for string class
cout << "Enter file name: ";
cin >> fileName;
outfile.open( fileName, ios::out ); // open file for writing
It gives compiling error: "cannot convert parameter 1 from 'class apstring' to 'const char *" so i'm guessing it has something to do with the way apstring is defined in apstring.h, but if you have any knowledge about this, or about how to make it so it works, I'd be very thankful.
Them ignorants complain that we who control this space station think we're God. We're not God. We just use the "Smite" button profusely.My Website