Home > Backend Development > C++ > In C/C++, towupper() function

In C/C++, towupper() function

WBOY
Release: 2023-08-29 12:01:06
forward
1037 people have browsed it

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,

wint_t towupper( wint_t ch );
Copy after login

Here is an example of towupper() in C language,

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;
}
Copy after login

Output

The uppercase string : HELLO WORLD!
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template