   Pointers
  typedef struct { int height, width;} map_t;map_t loading;Using the above code, I then tried to fscanf 2 values from a file using this code:fscanf(f, "%d %d\n", &loading.width, &loading.height);However, when I try to retrieve these values and use them, they are not there, can someone please teach me a better/correct way to scan values in and use them  I''d be very grateful. ShalRath  
  That code should work.  Here, this is a complete simple code which should work.   #include <stdio.h>typedef struct {int height, width;} map_t;void main(){FILE *fp;map_t loading;loading.height = 0;loading.width = 0;if(NULL!=(fp = fopen("test.txt","rb"))){fscanf(fp,"%d%d", &loading.width, &loading.height);printf("The width:\t%d\n""The height:\t%d\n",loading.width, loading.height); fclose(fp);}}  Name the file whatever you want, and just keep the two values separated.  ;  the \n in the fscanf string might be screwing things up - get rid of it and see if that helps.  ;  ahhhhhhhhhhhhhhhhhh, still the same problems, only now some of them read, SOMETIMES, it is really starting to irritate me, thanks for the help guys, I''ll keep working on it ;  I figured it out, I just have to type cast them everytime I want to use them, grrrrrrrrrrrrrrr....  