Pushes a character back into a stream.
int ungetc (int character, FILE * stream);
Required Header |
<stdio.h> |
Return Value
This function returns the character pushed back. EOF indicates an error.
Parameters
character
The character to push back
stream
The pointer to the open FILE structure
Remarks
The ungetc attempts to push back character into stream. If the low-level buffers will allow a character to be returned, then the internal buffer pointers are updated. If not, then the Stream routines cache the character until it is needed, in which case only one character can be pushed back.