Gets a wide character from an input stream.
Standard I/O Package (libc.a)
#include <stdio.h>
wint_t getwc ( Stream)
FILE *Stream;
wint_t fgetwc (Stream) FILE *Stream;
wint_t getwchar (void)
The fgetwc subroutine obtains the next wide character from the input stream specified by the Stream parameter, converts it to the corresponding wide character code, and advances the file position indicator the number of bytes corresponding to the obtained multibyte character. The getwc subroutine is equivalent to the fgetwc subroutine, except that when implemented as a macro, it may evaluate the Stream parameter more than once. The getwchar subroutine is equivalent to the getwc subroutine with stdin (the standard input stream).
The first successful run of the fgetc (getc, getchar, fgetc, or getw Subroutine), fgets (gets or fgets Subroutine), fgetwc, fgetws (getws or fgetws Subroutine), fread (fread or fwrite Subroutine), fscanf, getc (getc, getchar, fgetc, or getw Subroutine), getchar (getc, getchar, fgetc, or getw Subroutine), gets (gets or fgets Subroutine), or scanf subroutine using a stream that returns data not supplied by a prior call to the ungetc or ungetwc subroutine marks the st_atime field for update.
Stream | Specifies input data. |
Upon successful completion, the getwc and fgetwc subroutines return the next wide character from the input stream pointed to by the Stream parameter. The getwchar subroutine returns the next wide character from the input stream pointed to by stdin.
If the end of the file is reached, an indicator is set and WEOF is returned. If a read error occurs, an error indicator is set, WEOF is returned, and the errno global variable is set to indicate the error.
If the getwc, fgetwc, or getwchar subroutine is unsuccessful because the stream is not buffered or data needs to be read into the buffer, it returns one of the following error codes:
The getwc, fgetwc, or getwchar subroutine is also unsuccessful due to the following error conditions:
Other wide character I/O subroutines: getws or fgetws (getws or fgetws Subroutine) subroutine, putwc, putwchar, or fputwc (putwc, putwchar, or fputwc Subroutine) subroutine, putws or fputws (putws or fputws Subroutine) subroutine, ungetwc subroutine.
Related standard I/O subroutines: fopen, freopen, or fdopen (fopen, fopen64, freopen, freopen64 or fdopen Subroutine) subroutine, gets or fgets (gets or fgets Subroutine) subroutine, fread (fread or fwrite Subroutine) subroutine, fwrite (fread or fwrite Subroutine) subroutine, printf, fprintf, sprintf, wsprintf, vprintf, vfprintf, vsprintf, or vwsprintf (printf, fprintf, sprintf, snprintf, wsprintf, vprintf, vfprintf, vsprintf, or vwsprintf Subroutine) subroutine, putc, putchar, fputc, or putw (putc, putchar, fputc, or putw Subroutine) subroutine, puts or fputs (puts or fputs Subroutine) subroutine.
Subroutines, Example Programs, and Libraries and Understanding Wide Character Input/Output Subroutines in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
National Language Support Overview in AIX 5L Version 5.2 National Language Support Guide and Reference.