Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
towupper() function in C/C++
The function iswupper() is a built-in function in C/C++. It converts the wide character into upper case. It is declared in “cwctype” header file in C++ language while “ctype.h” in C language. It takes a single character which is known as wide character. If the character is upper case, it is converted into it, otherwise no modifications happen.
Here is the syntax of towupper() in C++ language,
wint_t towupper( wint_t ch );
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;
}
Output
The uppercase string : HELLO WORLD!
Advertisements