•inFile.open(“datafile.dat”) restricts us, we can’t run
that program on another file, we’d like to make the file name an input to the
program
•To do so, we need code like the following:
–ifstream
inFile;
–string
fileName;
–
–cout
<< “Enter the input file name: ”;
–cin
>> filename;
–inFile.open(fileName.c_str());