What would be the easiest way to output text to the console from a file?
If the file was this:
This is
the
file I am reading
cout should print that to the console. Is there an echo command? or would I use getline?
Also, how can I accept a file from the command prompt?
does not work.Code:cout << "Enter a filename"; cin >> file; ifstream inFile; inFile.open(file);




Reply With Quote