onto the input stream pointed to by stream. The pushed-back bytes will be returned by subsequent reads on that stream in reverse order. A successful intervening call to a filepositioning function (fseek() , fsetpos() or rewind() ) for the same data stream will delete any pushed-back bytes for the stream. The external storage associated with the stream remains unchanged. BS2000 A call to one of the following functions cancels the effects of the ungetc call (e.g. backward positioning): fseek() , fsetpos() , lseek() , rewind() , fflush() . (End) One byte of pushback is guaranteed. If ungetc() is called too many times on the same stream without an intervening read or file-positioning operation on that stream, the pushback operation may fail. A maximum of {BUFSIZE} bytes can be pushed back in the C runtime system (see stdio.h ). If the value of c is equal to the macro EOF , the operation will fail and the input stream will remain unchanged. A successful call to ungetc() clears the end-of-file indicator for the stream. The value of the file-position indicator for the stream after reading or discarding all pushed-back bytes will be the same as it was before the bytes were pushed back. The file-position indicator is decremented by each successful call to ungetc() ; if its value was 0 before a call, its value will be indeterminate after the call. |