C/C++ 中的 towupper() 函数
iswupper() 函数是 C/C++ 中的一个内置函数。它将宽字符转换为大写。它在 C++ 语言中声明在 "cwctype" 头文件中,而在 C 语言中声明在 "ctype.h" 中。它采用一个称为宽字符的单个字符。如果字符为大写,则将其转换为大写,否则不做任何修改。
以下是 C++ 语言中 towupper() 的语法,
wint_t towupper( wint_t ch );
以下是 C++ 语言中 towupper() 的一个示例,
示例
#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;
}输出
The uppercase string : HELLO WORLD!
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP