Is there a way to set the output directory of a file in the same one where the executable is located and not where the executable is executed?
ofstream outputFile;
outputFile.open("text.txt");
outputFile<<"test";
When I click on the .exe it typically outputs the file in the same directory I started it but when I execute it in different ways say for example with a .BAT file, the output directory is automatically set where I started the .BAT file (not where the .exe is located)