Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Create account
Namespaces
Variants
    Views
    Actions

      putwchar

      From cppreference.com
      <c‎ |io
       
       
      File input/output
      Types and objects
      Functions
      File access
      Unformatted input/output
      (C95)(C95)
      (C95)
      (C95)(C95)
      (C95)
      putwchar
      (C95)
      (C95)

      Formatted input
       
      Defined in header<wchar.h>
      wint_t putwchar(wchar_t ch);
      (since C95)

      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 <locale.h>#include <stdio.h>#include <stdlib.h>#include <wchar.h> int main(){setlocale(LC_ALL,"en_US.utf8"); constwchar_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");returnEXIT_FAILURE;}} returnEXIT_SUCCESS;}

      Possible output:

      ∀∀

      [edit]References

      • C23 standard (ISO/IEC 9899:2024):
      • 7.31.3.9 The putwchar function (p: TBD)
      • C17 standard (ISO/IEC 9899:2018):
      • 7.29.3.9 The putwchar function (p: 310)
      • C11 standard (ISO/IEC 9899:2011):
      • 7.29.3.9 The putwchar function (p: 425)
      • C99 standard (ISO/IEC 9899:1999):
      • 7.24.3.9 The putwchar function (p: 370)

      [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=c/io/putwchar&oldid=159810"
      Navigation
      Toolbox
      • In other languages

      [8]ページ先頭

      ©2009-2025 Movatter.jp