1fputwc(3) Library Functions Manual fputwc(3)
2
3
4
6 fputwc, putwc - write a wide character to a FILE stream
7
9 Standard C library (libc, -lc)
10
12 #include <stdio.h>
13 #include <wchar.h>
14
15 wint_t fputwc(wchar_t wc, FILE *stream);
16 wint_t putwc(wchar_t wc, FILE *stream);
17
19 The fputwc() function is the wide-character equivalent of the fputc(3)
20 function. It writes the wide character wc to stream. If fer‐
21 ror(stream) becomes true, it returns WEOF. If a wide-character conver‐
22 sion error occurs, it sets errno to EILSEQ and returns WEOF. Other‐
23 wise, it returns wc.
24
25 The putwc() function or macro functions identically to fputwc(). It
26 may be implemented as a macro, and may evaluate its argument more than
27 once. There is no reason ever to use it.
28
29 For nonlocking counterparts, see unlocked_stdio(3).
30
32 On success, fputwc() function returns wc. Otherwise, WEOF is returned,
33 and errno is set to indicate the error.
34
36 Apart from the usual ones, there is
37
38 EILSEQ Conversion of wc to the stream's encoding fails.
39
41 For an explanation of the terms used in this section, see at‐
42 tributes(7).
43
44 ┌────────────────────────────────────────────┬───────────────┬─────────┐
45 │Interface │ Attribute │ Value │
46 ├────────────────────────────────────────────┼───────────────┼─────────┤
47 │fputwc(), putwc() │ Thread safety │ MT-Safe │
48 └────────────────────────────────────────────┴───────────────┴─────────┘
49
51 C11, POSIX.1-2008.
52
54 C99, POSIX.1-2001.
55
57 The behavior of fputwc() depends on the LC_CTYPE category of the cur‐
58 rent locale.
59
60 In the absence of additional information passed to the fopen(3) call,
61 it is reasonable to expect that fputwc() will actually write the multi‐
62 byte sequence corresponding to the wide character wc.
63
65 fgetwc(3), fputws(3), unlocked_stdio(3)
66
67
68
69Linux man-pages 6.04 2023-03-30 fputwc(3)