I have the file saved in my project directory. What could be the problem.Code:ifstream infile;
infile.open("input.txt");
Printable View
I have the file saved in my project directory. What could be the problem.Code:ifstream infile;
infile.open("input.txt");
The program runs from the Debug or Release folder.
...or any other directory that may have been set as current.
With GetCurrentDirectory you can see what your path is.
... and to make you life more simple and secure always use the full path name for your files