Writing to Text Files // Xcode

I’m a beginner and was watching the lesson of mosh of how to write to text files. I’m working in Xcode and after writing my code and running it:
(…) int main () {
ofstream file;
if (file.is_open() ) {
file << "Hello world! " << endl;
return 0;

I can not find the file in the project, mosh also didn’t really explained it where I could find it on Xcode. Could someone help me in this matter?
Thank you !

i think it should be in the directory of the code you are running try checking any folder or file is new in the directory itself…
finally if the code is correct and there is permission to run script by your system then u will definitely see it in the current directory