When I was creating my project with cpp on Xcode, I found a problem that I could only use a full path to open a file.
If I want to read a file, even though this file is under my project dir, I need to enter the full path.
Reading a config.txt under my project dir. config.txt directory: "/Users/MYNAME/Desktop/MYPROJECT/TextFolder/" Project directory: "/Users/MYNAME/Desktop/MYPROJECT/"
ifstream my file ("/Users/_MYNAME_/Desktop/MYPROJECT/config.txt");
How can I use relative path?