std:: putwchar
From ja.cppreference.net
|
ヘッダーで定義
<cwchar>
|
||
|
std::
wint_t
putwchar
(
wchar_t
ch
)
;
|
||
ワイド文字 ch を stdout に書き込みます。
目次 |
パラメータ
| ch | - | 書き込まれるワイド文字 |
戻り値
ch 成功時、 WEOF 失敗時。
例
このコードを実行
#include <clocale> #include <cstdio> #include <cstdlib> #include <cwchar> #include <initializer_list> int main() { std::setlocale(LC_ALL, "en_US.utf8"); for (const wchar_t ch : { L'\u2200', // Unicode name: "FOR ALL" L'∀', L'\n' }) if (std::putwchar(ch) == WEOF) { std::puts("I/O error in std::putwchar"); return EXIT_FAILURE; } return EXIT_SUCCESS; }
出力例:
∀∀
関連項目
|
文字を
stdout
に書き込む
(関数) |
|
|
ワイド文字をファイルストリームに書き込む
(関数) |
|
|
C documentation
for
putwchar
|
|