Tuesday, 21 August 2012

FileIO C++ Xcode


hey all, i'm trying open , write file. here code:

code:
    ofstream ofile;     ofile.open("mysample.txt");     ofile << "hello world, fileio.\n\np.s luke i'm father";     ofile.close();
the problem though flushing buffer .close, it's not creating file anywhere on disk. know what's wrong here?
 

it creating file, in working directory, defaults quite deep inside xcode project folder, executable file is. can either change working directory xcode uses, or add absolute path filename.
 


Forums Macs Mac Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment