std::putwchar
From cppreference.com
| ヘッダ <cwchar> で定義 |
||
| std::wint_t putwchar( wchar_t ch ); |
||
ワイド文字 ch を stdout に書き込みます。
目次 |
[編集] パラメータ
| 文字 | - | 書き込むワイド文字 |
[編集] 戻り値
成功した場合は 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に文字を書き込む (関数) | |
| ファイルストリームに1ワイド文字を書き込む (関数) | |
| Cドキュメント for putwchar
| |