putwchar() function in C/C++ Last Updated : 14 Sep, 2018 Comments Improve Suggest changes Like Article Like Report The putwchar() function in C/C++ writes a wide character to stdout (standard output). It is defined in CPP library . Syntax : wint_t putwchar(wchar_t ch) Parameter : The function accepts one mandatory parameter ch which specifies the wide character to be written. Return value : The function returns two value as below: This function returns the wide character represented by ch, on success It returns WEOF and the error indicator is set if the writing error occurs Below programs illustrate the above function: Program 1 : CPP // C++ program to illustrate // putwchar() function #include <bits/stdc++.h> using namespace std; int main() { setlocale(LC_ALL, "en_US.UTF-8"); // initiate the starting and // the last alphabet wchar_t first = L'\u05d0', last = L'\u05ea'; wcout << L"All Hebrew Alphabets : "; // print all the alphabets for (wchar_t i = first; i <= last; i++) { putwchar(i); putwchar(' '); } return 0; } Output: All Hebrew Alphabets : àÃ? Ã? Ã? Ã? Ã? Ã? Ã? Ã? Ã? Ã? Ã? Ã? àÃ? Ã? àÃÂĄ ÃÂĒ ÃÂĢ ÃÂĪ ÃÂĨ ÃÂĶ Ã§ ÃÂĻ ÃÂĐ ÃŠ Program 2 : CPP // C++ program to illustrate the // putwchar() function #include <bits/stdc++.h> using namespace std; int main() { wchar_t wc; // initializing the first // and last alphabets wchar_t first = 'A', last = 'Z'; wcout << L"All English Alphabets : "; // print all the alphabets from // first to the last for (wc = first; wc <= last; ++wc) { putwchar(wc); putwchar(' '); } return 0; } Output: All English Alphabets : A B C D E F G H I J K L M N O P Q R S T U V W X Y Z Comment More infoAdvertise with us Next Article putwchar() function in C/C++ A AmanSrivastava1 Follow Improve Article Tags : Misc C Language C++ CPP-Library C-Library +1 More Practice Tags : CPPMisc Similar Reads putchar() function in C The putchar(int ch) method in C is used to write a character, of unsigned char type, to stdout. This character is passed as the parameter to this method. Syntax: int putchar(int ch) Parameters: This method accepts a mandatory parameter ch which is the character to be written to stdout. Return Value: 1 min read wcsrchr() function in C/C++ The wcsrchr() function is a builtin function in C/C++ which searches for the last occurrence of a wide character in a wide string. It is defined within the cwchar header file in C++. Syntax: wcsrchr(str, ch) Parameters: The function accepts two parameters which are described below. str: It specifies 2 min read wmemchr() function in C/C++ The wmemchr() function in C/C++ Locate character in block of wide characters. This function searches within the first num wide characters of the block pointed by ptr for the first occurrence of ch, and returns a pointer to it. Syntax: const wchar_t* wmemchr( const wchar_t* ptr, wchar_t ch, size_t nu 3 min read towctrans() function in C/C++ The towctrans() is a built-in function in C/C++ which applies a transformation to the wide character wc specified by desc. It is defined within the cwctype header file of C/C++. Syntax: wint_t towctrans(wint_t wc, wctype_t desc) Parameter: The function accepts two mandatory parameter which are descr 2 min read wcschr() function in C++ wcschr() function in C++ searches for the first occurrence of a wide character in a wide string. The terminating null wide character is considered part of the string. Therefore, it can also be located in order to retrieve a pointer to the end of a wide string. Syntax: const wchar_t* wcschr (const wc 2 min read Like