Xcode on mac

Hi All,
one question, i am coding c++ on mac's Xcode complier,
I can't find the example.txt file that the complier created as following:
i thought the file should be create inside the folder where my complied file is, but it is not.

#include <iostream>
#include <fstream>
using namespace std;

int main () {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}

so, where i can find "example.txt" file?
if i use finder, it doesn't help me, i am new to mac and Xcode.
thanks.
It should appear in the directory/folder that was active when you ran your program.
Thanks Duoas,

on the right corner of Xcode you see, for example, Full path: /Users/blabla/Desktop/c++/compare files/compare files/compare files/main.cpp,

and i assumed that the txt file should appear in the last "compare files" folder along with main.cpp, but there is only main.cpp file.
why?
In the Xcode menu, click on Preferences...
In the dialogue box, click on Locations
Look for where the derived data path leads and have a look there.
Thanks Grey, Now i know:)
Last edited on
Topic archived. No new replies allowed.