Hello, first post. I was just wondering how you create a 3 by 3 array from a ".txt" file. Just imagine this was inside the text file.
0 1 0
1 0 1
1 0 0
For my assignment, the text could change so I can't just create an array with the information as prior knowledge. I believe you would use something along the lines of ifstream or infile, I just don't completely understand these concepts yet. Thank you.
I know how to setup the array. I just dont know what to make every individual coordinate equal to the text file. I would assume you would need to use two for loops. This is what I do know.
int array[3][3];
for (int x = 0; x <= 2; x++)
{
for (int y = 0; y <= 2; y++)
{
array[x][y] = ***I don't know how to extract each coordinate from the file****;
}
}