Does anyone know why the file isn't opening? I also tried just putting "infile.txt" and placing it in the folder of the program and also the debug folder but the ways I used to check for open error both triggered meaning that it could not open. I know I can hard code the location but I don't want to.
I heard you should do
using namespace std;
string fileloc = "infile.txt";
cout << "open fail 1" << endl;
bool fail = infile.fail();
cout << "open fail 2";
Note that the directory structure (at least for VS2013) is
<base> - Solution Directory - Debug - Release - Project Directory - Debug - Release
The program by default runs in the project directory (even though it is built to the solution/debug directory).
If you accepted the default naming convention when starting your project, you should be putting your file in the "Projects\ConsoleApplication1\ConsoleApplication1" directory, not "Projects\ConsoleApplication1"