Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::putwchar(3)	      C++ Standard Libary	      std::putwchar(3)

NAME
       std::putwchar - std::putwchar

Synopsis
	  Defined in header <cwchar>
	  std::wint_t putwchar(	wchar_t	ch );

	  Writes a wide	character ch to	stdout.

Parameters
	  ch - wide character to be written

Return value
	  ch on	success, WEOF on failure.

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	(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;
	}

Possible output:

See also
	  putchar writes a character to	stdout
		  (function)
	  fputwc  writes a wide	character to a file stream
	  putwc	  (function)
	  C documentation for
	  putwchar

http://cppreference.com		  2024.06.10		      std::putwchar(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::putwchar&sektion=3&manpath=FreeBSD+Ports+15.1.quarterly>

home | help