ungetwc

Pushes a wide character back into the input stream.

Format

#include  <wchar.h>

wint_t ungetwc  (wint_t wc, FILE *file_ptr);

Arguments

wc
A value of type wint_t.
file_ptr
A file pointer.

Description

When using this function, the wide character is pushed back onto the file indicated by file_ptr.

One push-back is guaranteed, even if there has been no previous activity on the file. If a file positioning function (such as fseek) is called before the pushed back character is read, the bytes representing the pushed back character are lost.

If the character to be pushed back is WEOF, the operation fails, the input stream is left unchanged, and WEOF is returned.

See also getwc in this section.

Return Values
The push-back character. 
WEOF  Indicates that the function cannot push the character back. errno is set to one of the following:

  • EBADF - The file descriptor is not valid.

  • EALREADY - Operation is already in progress on the same file.

  • EILSEQ - Invalid wide-character code detected.
 


Previous Page | Next Page | Table of Contents | Index