• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

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?
0
NSing9
Asked:
NSing9
  • 3
1 Solution
 
phoffricCommented:
If using Visual Studio, place your text file in the folder having the project file (not solution); i.e., the folder that contains the .vcproj file.
0
 
phoffricCommented:
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.
0
 
phoffricCommented:
0
 
NSing9Author Commented:
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.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now