HEY EVERYBODY
I need a little bit of help. I am working on a project where I'm required to write functions. I have to stick to teh outline of the stub that they gave me so there is no changing prototypes for the functions.
What I have to do is write a function to read in information into a 2D array, which has been typedef Puzzle [M+2][N+2] where N=M=15 and the extra 2 are for the null character. The array that was typedef'd into Puzzle was initialized to 0 so enterring the null character is no problem.
The file is a list of 15 columns of 15 rows. I am confused on how to read this information into Puzzle...
void readPuzzle(Puzzle p)
{
fin.open("puzzle.dat");
for (int i=1; i <= M; i++)
for (int j=1; j <= N; j++)
{
p[i][j];
}
}
I am stuck and have been looking at this for a couple hours and dont' know where to go from here. I know this is pretty simple but I don't understand this...
IF anyone could help, I'd really really appreciate it
G'day
I need a little bit of help. I am working on a project where I'm required to write functions. I have to stick to teh outline of the stub that they gave me so there is no changing prototypes for the functions.
What I have to do is write a function to read in information into a 2D array, which has been typedef Puzzle [M+2][N+2] where N=M=15 and the extra 2 are for the null character. The array that was typedef'd into Puzzle was initialized to 0 so enterring the null character is no problem.
The file is a list of 15 columns of 15 rows. I am confused on how to read this information into Puzzle...
void readPuzzle(Puzzle p)
{
fin.open("puzzle.dat");
for (int i=1; i <= M; i++)
for (int j=1; j <= N; j++)
{
p[i][j];
}
}
I am stuck and have been looking at this for a couple hours and dont' know where to go from here. I know this is pretty simple but I don't understand this...
IF anyone could help, I'd really really appreciate it
G'day
