
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
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!
- Related Articles
- iswblank() function in C/C++
- iswpunct() function in C/C++
- strchr() function in C/C++
- strtod() function in C/C++
- memmove() function in C/C++
- memcpy() function in C/C++
- atexit() function in C/C++
- raise() function in C/C++
- mbrlen() function in C/C++
- strftime() function in C/C++
- iswlower() function in C/C++
- iswdigit() function in C/C++
- mbrtowc() function in C/C++
- Rename function in C/C++
- Remove function in C/C++

Advertisements