This topic is 1454 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm trying to load a binary file, and after testing to see if it passed, it fails every time. I assumed just putting the file name in the quotes would assume the default path of the exe. For example, lets say your exe is stuffed away in some folder such as C:\Programming\Loading Binary Files\ and you have a file called test.bin in the same folder as the exe. It still fails with this simple code:

#include <iostream>
#include <fstream>
using namespace std;

int main()
{
ifstream file ("test.bin", ios::in | ios::binary);
if(file)
{
cout << "passed" << endl;
file.close();
}
else
cout << "fail" << endl;

system("pause");
return 0;
}


So without having to type an entire path of the test.bin, what is the default path of the file assuming if you were to just put the file name in quotes and not a full file path? Thanks in advance.

Edited by Psychopathetica

##### Share on other sites
You want Working Directory in the Debugging section of Project Properties.

##### Share on other sites

Whoops wrong place. I did it in General lol. Thanks for the fix.