September 1998
Intermediate to advanced
848 pages
20h 13m
English
For each of the I/O functions in the preceding chapters, there is a similar file I/O function. The main distinction is that you need to use a FILE pointer to tell the new functions which file to work with. Like getc() and putc(), these functions require that you identify a file by using a pointer-to-FILE such as stdout or that you use the return value of fopen().
The file I/O functions fprintf() and fscanf() work just like printf() and scanf(), except that they require an additional first argument to identify the proper file. You've already used fprintf(). Listing 12.3 illustrates both of these file I/O functions along with the rewind() function.
Read now
Unlock full access