I am trying to write simple pgm file reading C program. I had to create simple structure:
typedef struct pgmImage {
int R; //rows
int C; //collumns
int G; //grey scale
int **pix; // array of pixels
}Image;
Now i have to initialize empty Image structure.I need one to set all variables based on *.pgm file in other function. All the time i am getting "unable to read memory" and 'unitialized local variable x used'. I have tried to simply do :
Image *x=0;
but program crashes when read function try to set R,C,G values.