[Previous] [Contents] [Index] [Next]

ungetwc()

Push a wide character back onto an input stream

Synopsis:

#include <wchar.h>

wint_t ungetwc( wint_t wc,
                FILE * fp );

Library:

libc

Description:

The ungetwc() function pushes the wide character specified by wc back onto the input stream pointed to by fp.

The pushed-back character will be returned by the next read on the stream but is discarded if a call is made to the fflush() function or to a file-positioning function (fseek(), fsetpos(), or rewind()) before the next read operation is performed.

Only one character (the most recent one) of pushback is guaranteed.

The ungetwc() function clears the end-of-file indicator, unless the value of wc is wEOF.

Returns:

The character pushed back.

Errors:

EILSEQ
Invalid character sequence or wide character.

Classification:

ANSI

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

"Stream I/O functions" and "Wide-character functions" in the summary of functions chapter.


[Previous] [Contents] [Index] [Next]