I checked for forums but I found like this:
ofstream outfile;
outfile.open ("test.txt");
outfile.open ("\\data\\test.txt");
But I want to open a file in same level directory. How can I do this?
My C++ exe file is in release directory, I need to open a file in log directory.
root
-somefolder
--release
--test
--log
This didn’t worked:
outfile.open(".\\log\\test.txt",ios::app)
Try
outfile.open("..\\log\\test.txt",ios::app)