So I'm developing in C++ with the latest version of Visual Studio Desktop, however it refuses to open any text file unless it is in the same directory as the source file. It doesn't matter if I explicitly tell it to look somewhere else, it won't find it unless it's in the same directory as the source file. However if I run the executable without visual studio, it can find it just fine. It's only when visual studio runs it. Can someone tell me why this is? And possibly how to fix it?
Think about opening a file from the program:
If you use both Debug and Release modes (you will, someday), it will look from the Project directory.
This allows to have some consistency when running from Debug/Release mode without having to copy files over from a directory to the other.
If you really had files in program.exe's directory, you will have to copy all the files to the other directory for the final compile.
If you don't want this to happen, open the Project's properties, and under Debug, change the Working Directory to the one you wish to use.