名前空間
変種
操作

std::putwchar

From cppreference.com
< cpp‎ | io‎ | c
 
 
 
C形式I/O
型とオブジェクト
関数
ファイルアクセス
直接入出力
非書式化入出力
書式付き入力
(C++11)(C++11)(C++11)    
(C++11)(C++11)(C++11)    
書式付き出力
ファイルポジショニング
エラーハンドリング
ファイル操作
 
ヘッダ <cwchar> で定義
std::wint_t putwchar( wchar_t ch );

ワイド文字 chstdout に書き込みます。

目次

[編集] パラメータ

文字 - 書き込むワイド文字

[編集] 戻り値

成功した場合は 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
English 日本語 中文(简体) 中文(繁體)