I'm writing a program using C++.
In one of my functions I need to open a .txt file using an std::ifstream.
This file is supposed to be located in the same folder as the executable.
I'm using a relative path.
However when launching my program directly from CodeBlocks, it can't find the file.
If I copy the .txt file into ...\bin\Debug and launch the executable manually, it works just fine.
Absolute paths work fine from CodeBlocks.
How can I make the relative path work when launching my program directly from CodeBlocks?