[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    getwc(3I) manual page Table of Contents

Name

getwc, getwchar, fgetwc - convert EUC character from the stream to Process Code

Synopsis

cc [ flag ... ] file ... -lw [ library ... ]


#include <stdio.h>
#include <widec.h>

wint_t getwc(FILE *stream);

wint_t getwchar(void);

wint_t fgetwc (FILE *stream);

MT-Level

MT-Safe

Description

getwc() and fgetwc() convert the next Extended Unix Code (EUC) character from the named input stream into a wchar_t Process Code character, and return it as an integer. They also move the file pointer, if defined, ahead one EUC character in the stream. getwchar() is defined as fgetwc(stdin). getwc() and getwchar() are macros.

Return Values

These functions return the integer constant EOF at end-of-file or upon an error. The end-of-file condition is remembered, even on a terminal, and all subsequent attempts to read will return EOF until the condition is cleared with clearerr() (see ferror(3S) ).

See Also

ferror(3S) , fopen(3S) , fread(3S) , getws(3I) , putwc(3I) , scanf(3S) , ungetwc(3I)

Warning

If the integer value returned by getwc(), getwchar(), or fgetwc()" is stored into a wchar_t variable and then compared against the integer constant EOF , the comparison will not succeed, because wchar_t is defined as unsigned.


Table of Contents