I am a first semester programmer @ FSU. I am having a little trouble on a portion of an assignment about File I/O.
We are supposed to ask the user what the name of the file is and then open the file and do something with the it, as well as check and see if the file is open. I am having trouble on the getting the file name part, and then opening the file.
The code I have is
Code:ifstream inputFile; stream fileName; ... cout << "Please enter the name of the file you wish to decode: "; cin >> fileName; inputFile.open(fileName); while (!inputFile){ cout << "Error reading file!" << endl; cout << "Please try again: " << endl; cin >> fileName; }