Re: Using fstream
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