NSing9
asked on
Where must the text file (.txt) be placed in a C++ project when reading input for this file isntead of from the console?
Where must the text file (.txt) be placed in a C++ project when reading input from this file instead of from the console? I have a program and am trying to code it to read from a text file instead of have the input entered from the keyboard. I don't know exactly where to place the file in my project. Does it go in the folder with the header files, source files, or resource files?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The .vcproj advice is for case when running the program via VS. If you create the .exe file and run the .exe directly from a console, then put the text file in the same folder as the .exe file.
For other Visual Studio options, see:
https://www.experts-exchange.com/questions/26579762/Arguments-for-main-function.html
https://www.experts-exchange.com/questions/26579762/Arguments-for-main-function.html
ASKER
That actually is where the file already was. So thank you. It appears that my problem is something else so I will post a separate question.