Because there are two types of file streams, text streams, and binary streams, there are also different sets of functions to manipulate them.
We have already seen most of the functions that are useful for text streams. They are as follows:
- fprintf(): Writes formatted text to the output stream
- fscanf(): Reads and interprets formatted text from the input stream
- fputs(): Writes an unformatted line to the output stream
- fgets(): Reads an unformatted line from the input stream
There are also some single-character functions that we have come across:
- fgetc(): Reads a single character from the input stream
- fputc(): Writes a single character to the output stream
- ungetc(): Puts a single character back into the input stream
These single-character functions are particularly handy when processing the input of...