Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::putwchar

      From cppreference.com
      <cpp‎ |io‎ |c
       
       
       
       
      Defined in header<cwchar>
      std::wint_t putwchar(wchar_t ch);

      Writes a wide characterch tostdout.

      Contents

      [edit]Parameters

      ch - wide character to be written

      [edit]Return value

      ch on success,WEOF on failure.

      [edit]Example

      Run this code
      #include <clocale>#include <cstdio>#include <cstdlib>#include <cwchar>#include <initializer_list> int main(){std::setlocale(LC_ALL,"en_US.utf8"); for(constwchar_t ch:{        L'\u2200',// Unicode name: "FOR ALL"        L'∀',        L'\n'})if(std::putwchar(ch)== WEOF){std::puts("I/O error in std::putwchar");returnEXIT_FAILURE;} returnEXIT_SUCCESS;}

      Possible output:

      ∀∀

      [edit]See also

      writes a character tostdout
      (function)[edit]
      writes a wide character to a file stream
      (function)[edit]
      C documentation forputwchar
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/io/c/putwchar&oldid=160029"

      [8]ページ先頭

      ©2009-2025 Movatter.jp