I'm trying to get file i/o working for my program. I've gotten it to read from a file when I go and do:
The program reads the file and there are no problems. The thing I want to do is ask the user for the filename and insert the filename where Info3.txt is. The problem with doing that from what I've figured out is that the program believes that the variable is the filename. The only thing I could think of that would fix this is to go like this:Code:ifstream fin("Info3.txt"); fin.getline(cipher, *sizeOfMessage, '\n');
Where I have the variable userInput which contains the filename. But I would have to write code that would insert quotation marks at the beginning and end of the variable userInputCode:ifstream fin(userInput); fin.getline(cipher, *sizeOfMessage, '\n');
Does anyone have any ideas to fix this other than the way I came up with?