Other Standard I/O Functions

The ANSI standard library contains over three dozen functions in the standard I/O family. Although we don't cover them all here, we will briefly describe a few more to give you a better idea of what is available. We'll list each function by its ANSI C prototype to indicate its arguments and return values. Of those functions we discuss here, all but setvbuf() are also available in pre-ANSI implementations. Appendix F, "The Standard ANSI C Library," lists the full ANSI C standard I/O package.

The int ungetc(int c, FILE *fp) Function

The int ungetc(int c, FILE *fp) function pushes the character specified by c back onto the input stream. If you push a character onto the input stream, the next call to a standard input ...

Get C Primer Plus®, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.