Hi all, I'm trying to read a PPM image into an array. The header will have already been read in and I'm trying to put in a 2-d array to make manipulations easier. This is the code I have so far with LOTS of errors and warnings and I honestly don't know what almost any of them mean.
Code:
int imageArray( FILE *input, struct pixel *theArray ){
int i, j;
int col, row;
int *imageArray = (int**)malloc(row * sizeof(int*));
for(i=0; i<row; i++){
imageArray[i]=(int*)malloc(col * sizeof(int));
for(j=0; j<col; j++){
fscanf(fpi, "%d", &imageArray[i][j];
}
}
return 0;
}