ungetc

Pushes a character back onto the specified input stream

Local Servers:nonblocking
Remote Servers:nonblocking
Classification:ANSI
Platform:NLM
Service:Stream I/O

Syntax

  #include <stdio.h> 
    
  int ungetc  (  
     int     c,   
     FILE   *fp);
  

Parameters

c
(IN) Specifies the character to be pushed back onto the specified input stream.
fp
(IN) Points to the input stream.

Return Values

The ungetc function returns the character pushed back.

Remarks

The ungetc function pushes the character specified by c back onto the input stream specified by fp. This character is returned by the next read from the stream. Only the last character returned in this way is remembered.

The ungetc function clears the EOF indicator, unless the value of c is EOF.

See Also

fopen getc