putwchar
From cppreference.net
File input/output
| Types and objects | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
定義先ヘッダ
<wchar.h>
|
||
|
wint_t putwchar
(
wchar_t
ch
)
;
|
(C95以降) | |
ワイド文字
ch
を
stdout
に書き込みます。
目次 |
パラメータ
| ch | - | 書き込まれるワイド文字 |
戻り値
ch 成功時、 WEOF 失敗時。
例
このコードを実行
#include <locale.h> #include <stdio.h> #include <stdlib.h> #include <wchar.h> int main() { setlocale(LC_ALL, "en_US.utf8"); const wchar_t data[] = { L'\u2200', // Unicode name: "FOR ALL" L'∀', L'\n', }; for (size_t t = 0; t != (sizeof data / sizeof(wchar_t)); ++t) { if (putwchar(data[t]) == WEOF) { puts("I/O error in putwchar"); return EXIT_FAILURE; } } return EXIT_SUCCESS; }
出力例:
∀∀
参考文献
- C23規格 (ISO/IEC 9899:2024):
-
- 7.31.3.9 putwchar関数 (p: TBD)
- C17規格 (ISO/IEC 9899:2018):
-
- 7.29.3.9 putwchar関数 (p: 310)
- C11規格 (ISO/IEC 9899:2011):
-
- 7.29.3.9 putwchar関数 (p: 425)
- C99規格 (ISO/IEC 9899:1999):
-
- 7.24.3.9 putwchar関数 (p: 370)
関連項目
|
文字を
stdout
に書き込む
(関数) |
|
|
(C95)
|
ワイド文字をファイルストリームに書き込む
(関数) |
|
C++ documentation
for
putwchar
|
|