Given the following short example
FILE *p = fopen("foo.txt", "r");
FILE f = *p;
int i;
fscanf(p, "%i", &i); // works just fine
fscanf(&f, "%i", &i); // segmentation fault
I have read a little about FILE, FILE * as well as the actual struct type _IO_FILE, but it isn't really clear to me what is causing the segmentation fault in the second call to fscanf.
So aside from p and &f containing different addresses and unless this is involved (which I think it is), what is the difference between &f and p in this context?
 
     
     
    