I have to write a program as an assignment homework that outputs from a textfile as infile, the Low average temps, high average temps, Lowest temp and that city, highest temp and from that city. As I went to run this within xcode, it said it could not find the text file. Any suggestions??
I'm not familiar with the particular system you're running on, but it sounds like it may just be a problem with your program looking in the wrong place for the input file. Visual Studio causes problems like this, as it puts the executable program in different subfolders of your project depending on the type of build you make (debug, release, etc...) Have you tried copying the executable program and the data file to the same folder manually and running the program from a command prompt?
another option might be to just put the data file into a specific folder and forcing the program to look there: infile.open( "C:\Junk\temps.txt" );
that's not pretty, and probably won't work if you have to turn this in as an assignment, but it'll get the job done.