getwchar()

get wide character from standard input 

Function


SYNOPSIS

#include <stdio.h>

#include <wchar.h>

wint_t getwchar(void);


DESCRIPTION

The getwchar() function obtains the next wide character from stdin, the standard input stream. The returned value is a UNICODE representation. If stdin is open in binary mode, then getwchar() simply reads the next UNICODE value from it. If stdin is open in text mode, getwchar() converts the incoming character from multibyte to wide format.

If stdin has a file position indicator, getwchar() advances it by the length of the character it read.

The function getwchar() is equivalent to getwc() with the argument stdin.


PARAMETERS

None.


RETURN VALUES

The getwchar() function returns the next character from the standard input stream. If the stream is at the end of the file, the end-of-file indicator for the stream is set and getwchar() returns WEOF. If a read error occurs, the error indicator for the stream is set and getwchar() returns WEOF. The functions feof() and ferror() can be used to distinguish error conditions from WEOF.

On failure, errno is set to one of the following values:

EACCES 

Another process has the file locked.

EBADF 

Standard input stream stdin is not a valid stream opened for reading.

EILSEQ 

The input is not a valid character code.

EINTR 

A signal interrupted the call.

EIO 

An input error occurred.

EISDIR 

The open object is a directory, not a file.

ENOMEM 

Memory could not be allocated for internal buffers.

ENXIO 

A device error occurred.

EOVERFLOW 

The file is a regular file and an attempt was made to read at or beyond the offset maximum associated with the corresponding stream.

EWOULDBLOCK 

The underlying file descriptor is a non-blocking socket and no data is ready to be read.


CONFORMANCE

ANSI/ISO 9899-1990/AM 1-1995.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

If the standard input stream is from a file open in text mode, the line-terminating character sequence of carriage return plus linefeed is translated to linefeed on input. No such translation occurs for files open in binary mode.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
feof(), ferror(), fgetwc(), fopen(), getw(), getwc()


PTC MKS Toolkit 10.4 Documentation Build 39.