• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using fstream
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using fstream


  • Subject: Re: Using fstream
  • From: Chris Espinosa <email@hidden>
  • Date: Thu, 8 Feb 2007 17:09:31 -0800


On Feb 8, 2007, at 4:23 PM, Adam wrote:

Thank you for your response to my question. Are you saying that I need to localize the variables? I would normally do this but it was just a quick program thrown together to see if it would work, so I understand how that could really mess up my computer in bigger programs. Is there another way that it could hurt the program? I think there might be something wrong with using arr_words[50] and fin.getline(arr_words, 49) but I figured that I didn't want to go too far, and only 30 characters is all I need. 
The problem is not C++, as far as I can tell, but in the execution of the program. The problem that I am facing is that when I execute this, the output it gives me is 0, which means that something didn't work in the transfer... that's the reason it's on the xcode list and not somewhere else. I think it's in the development mode, but I don't know much about those so I don't want to wreck my program. It's set to debug right now... does this help?

Your main issue is the assumption that the file "input.txt" can be found in the working directory of the executable, which is not a valid assumption (on OS X or any other system).  If this is what you want, select your Executable in the Xcode project, choose Get Info, and in the General tab set the Working Directory to the Project directory.

The fact that you're writing to the same file as you're inputing from may also be an issue.

Chris
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • otool and x86-64
      • From: Sanjay Patel <email@hidden>
References: 
 >Using fstream (From: Adam <email@hidden>)
 >Re: Using fstream (From: John Daniel <email@hidden>)
 >Re: Using fstream (From: Adam <email@hidden>)

  • Prev by Date: Re: Using fstream
  • Next by Date: Compile acts differently when run from terminal and in debugger???
  • Previous by thread: Re: Using fstream
  • Next by thread: otool and x86-64
  • Index(es):
    • Date
    • Thread