![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Iswctype() function in C++ STL
In C++ standard template libraray(STL), iswctype() function is used to check if the given wide character has property specified by desc.
Iswctype() is an in built function whose header file is “ctype.h”.
Syntax of Iswctype() is as follows
int iswctype(wint_t c, wctype_t desc); iswctype () / Checks whether whether c has the property specified by desc. /
Synopsis
int iswctype(wint_t c, wctype_t desc);
Parameters
C − To check the wide characters which are casted to the integral type wint_t
Desc − It is a value which is returned by the call to wctype, which is a scalar type which is used as return type for wctype(Wide character type).
Return Value
A value different from zero (i.e., true) if indeed c is has the property identified by desc. Zero (i.e., false) otherwise.
PROGRAM FOR ISWCTYPE () FUNCTION IN C
#include <stdio.h> #include <wctype.h> int main (){ int i=0; wchar_t str[] = L"Test String.\n"; wchar_t c; wctype_t check = wctype("lower"); wctrans_t trans = wctrans("toupper"); while (str[i]){ c = str[i]; if (iswctype(c,check)) c = towctrans(c,trans); putwchar (c); i++; } return 0; }
Output
If we run the above code it will generate the following output −
TEST STRING.
Advertisements