Go to main content

man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2017
 
 

getwc(3C)

Name

getwc - get wide character from a stream

Synopsis

#include <stdio.h>
#include <wchar.h>

wint_t getwc(FILE *stream);

Description

The getwc() function is equivalent to fgetwc(3C), except that if it is implemented as a macro it may evaluate stream more than once, so the argument should never be an expression with side effects.

Return Values

Refer to fgetwc(3C).

Errors

Refer to fgetwc(3C).

Usage

This interface is provided to align with some current implementations and with possible future ISO standards.

Because it may be implemented as a macro, getwc() may treat incorrectly a stream argument with side effects. In particular, getwc(*f ++) may not work as expected. Therefore, use of this function is not recommended; fgetwc(3C) should be used instead.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Standard
MT-Level
MT-Safe

See Also

fgetwc(3C), attributes(5), standards(5)