I code on two different systems, Windows in class, macOS at home. Basically, xCode will not read from files correctly (or at all).
I've ran this code on both systems
"bacteria.txt" is a list of indeces for the array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
void start(bool game[][SIZE])
{
ifstream bacteria;
int row, colm;
init (game);
//open file
bacteria.open("bacteria.txt");
//test for file
if (!bacteria)
cout<<"File not found"<<endl;
//taking indices from file
bacteria>>row>>colm;
while (bacteria)
{
game[row][colm]=true;
bacteria>>row>>colm;
}
//close file
bacteria.close();
}
|
The array gets the correct information on Windows, the array remains entirely false in xCode (it is initialized as such).
I've never gotten a file to read correctly in xCode. Is there some sort of different type of system command that is necessary to do this properly?
I (also frustrating) use a custom directory. The final DOES open, but I cannot get anything to read from it.
Also, yes, I've tried .rtf, doesn't work.
Any help would be appreciated!