Next: Formatted Input Output Up: Input and Output Previous: Character Input and

Formatted Input Output with File Pointers

Similarly there are equivalents to the functions printf and scanf which read or write data to files. These are called fprintf and fscanf. You have already seen fprintf being used to write data to stderr.

The functions are used in the same way, except that the fprintf and fscanf take the file pointer as an additional first argument.

January 1995