Returns one character to a stream input/output file.
long ungetc (long c, FILE *fp);
The ungetc function returns character c to the stream input/output file indicated by file pointer fp. Unless the fflush, fseek, or rewind function is called, this returned character will be the next input data.
The ungetc function normally returns c, which is the returned character, but returns EOF when an error occurs.
The behavior is not guaranteed when the ungetc function is called more than once without intervening fflush, fseek, or rewind function execution. When the ungetc function is executed, the current file position indicator for that file is moved back one position; however, when this file position indicator has already been positioned at the beginning of the file, its value is not guaranteed.