ungetwc

Pushes a wide character back onto the specified input stream.

Library:LibC
Classification:ANSI
Service:Characters and Strings

Syntax

  #include <wchar.h> 
   
  wint_t  ungetwc (
     wint_t          wc,
     struct _iobuf   *fp);
  

Parameters

wc

(IN) Specifies the wide character to push back onto the specified input stream.

fp

(IN) Points to the input stream.

Return Values

If successful, returns the character pushed back. Otherwise, returns WEOF.

Remarks

The ungetwc function pushes the character specified by wc 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.

If the value of wc equals WEOF, the operation fails and the stream is unchanged.

See Also