Input/Output with files in XCode

Discussion in 'Mac Programming' started by crisro996, Jul 21, 2012.

  1. crisro996, Jul 21, 2012
    Last edited: Jul 21, 2012

    crisro996 macrumors newbie

    Jul 11, 2012
    Hi there, I'm trying to learn C++ on Mac or actually learn to use XCode :D

    I have managed to get input/output with working, but after giving the full path of the file I was writing in/reading from:
    ifstream f("users/.../")
    My question is, how can I just give the location as
    ifstream f("")
    I've been studying C++ on Windows until now and it's really simple in MS VC++, you just put the name of the file and you're good to go.
  2. chown33 macrumors 604

    Aug 9, 2009
    Sailing beyond the sunset
    That's not a full path, so it won't work. Please post what you actually used.

    You should study what working directory and relative path means.

    Then learn how to change your working directory in Xcode.
  3. crisro996 thread starter macrumors newbie

    Jul 11, 2012

Share This Page