#include <stdio.h>
int ungetc(int c, FILE *stream);
The ungetc() function
pushes the character specified by integer c,
cast to an unsigned char, back onto the input
stream pointed to by stream. The end-of-file indicator for
stream is cleared, and subsequent reads will get any
pushed-back bytes in the reverse order that they were pushed. No
actual writes, however, are performed to the file or other
underlying storage of stream.
A successful call to a file-positioning
function for stream, such as fsetpos()
or rewind(), discards any pushed back bytes for the stream.
The pushback buffer is limited.
Repeated calls to ungetc() with no intervening read or
file positioning operations fail.
- c
-
Is the character to push back onto stream.
- stream
-
Points to the input stream.
If successful, the ungetc()
function returns the character pushed back after conversion. On
failure, ungetc() returns an EOF.
ANSI/ISO 9899-1990.
MT-Safe.
None.
MKS Toolkit for Professional Developers
MKS Toolkit for Enterprise Developers
MKS Toolkit for Enterprise Developers 64-Bit Edition
- Functions:
- fputc(), fsetpos(), rewind()
MKS Toolkit 9.3 Documentation Build 6.