VMS Help  —  CRTL  ungetwc
    Pushes a wide character back into the input stream.

    Format

      #include  <wchar.h>

      wint_t ungetwc  (wint_t wc, FILE *file_ptr);

1  –  Arguments

 wc

    A value of type wint_t.

 file_ptr

    A file pointer.

2  –  Description

    When using the ungetwc 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.

3  –  Return Values

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

                       o  EBADF - The file descriptor is not valid.

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

                       o  EILSEQ - Invalid wide-character code
                          detected.
Close Help