The C standard i/o library defines a type: FILE
No one every pays much attention to exactly how this type is defined in terms of other C basic types. You don't need to know.
The fopen function is used to read in information about a named file and prepare it for reading and/or writing.
This function returns a value which is of type pointer to FILE.
The fprintf or fscanf functions for writing to or reading from the file just pass this pointer, rather than the file name.
FILE *fp; fp = fopen("foo.txt", "r"); if ( fp == NULL ) { printf("Unable to open input file foo.txt\n"); exit(1); } const int N = 128; char buf[N]; // Read a line from foo.txt fgets(buf, N, fp); // or read an integer from the next line of foo.txt int k; int numcnv; numcnv = fscanf(fp, "%d", &k); if ( numcnv != 1 ) { printf("Unable to read an integer from foo.txt"); } fclose(fp); // fp is no longer associated with foo.txt