#include Home >
Article > Backend Development > In C/C++, towupper() function The function iswupper() is a built-in function in C/C. It converts wide characters to uppercase characters. The C language is declared in the "cwctype" header file, and the C language is declared in the "ctype.h" header file. It takes a single character, called a wide character. If the character is uppercase, it is converted to uppercase, otherwise no modification occurs. The following is the syntax of towupper() in C language, Here is an example of towupper() in C language, The above is the detailed content of In C/C++, towupper() function. For more information, please follow other related articles on the PHP Chinese website!In C/C++, towupper() function
wint_t towupper( wint_t ch );
Example
#include <cwchar>
#include <cwctype>
#include <iostream>
using namespace std;
int main() {
wchar_t s[] = L"hello world!";
wcout << L"The uppercase string":
<< L"\"is ";
for (int i = 0; i < wcslen(s); i++)
putwchar(towupper(s[i]));
return 0;
}
Output
The uppercase string : HELLO WORLD!