I am having trouble with file i/o while using Xcode. My program is written in C++ and needs to read a file for input. I know my code works because it compiles correctly in CodeWarrior on a Win32 platform. I've tried putting the file to be read in every concievible place where Xcode may want to read the file (including the root folder, the folder which contains the source code file, the folder which contains the Xcode application, etc...). What can I do about this?
Thank you,
Matthew
The following is my code snippet:
Thank you,
Matthew
The following is my code snippet:
Code:
int row;
int col;
ifstream infile;
infile.open("firstGenData.txt");
assert(infile); // I know this is odd but it's
// what my instructor wanted
infile >> row >> col;
while (infile)
{
currGen[row][col] = '*';
infile >> row >> col;
}
infile.close();
infile.clear();