
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
iswalnum() function in C++ STL
iswalnum() function in C++ STL checks if the given wide character is an alphanumeric character, i.e. either a number (0-9), an uppercase letter(A-Z), a lowercase letter (a-z) or any alphanumeric character or not.
Algorithm
Begin Initializes the characters. Call function iswalnum(c1) to check whether it is alphanumeric or not. If it is alphanumeric character, then value will be returned otherwise zero will be returned. End
Example Code
#include <cwctype> #include <iostream> using namespace std; int main() { wchar_t c1 = '/'; wchar_t c2 = 'a'; if (iswalnum(c1)) wcout << c1 << " is alphanumeric "; else wcout << c1 << " is not alphanumeric "; wcout << endl; if (iswalnum(c2)) wcout << c2 << " is alphanumeric "; else wcout << c2 << " is not alphanumeric "; return 0; }
Output
/ is not alphanumeric a is alphanumeric
- Related Articles
- sinh() function in C++ STL
- cosh() function in C++ STL
- atanh() function in C++ STL
- tanh() function in C++ STL
- acosh() function in C++ STL
- asinh() function in C++ STL
- acos() function in C++ STL
- atan2() function in C++ STL
- iswalpha() function in C++ STL
- lldiv() function in C++ STL
- negate function in C++ STL
- iswpunct() function in C++ STL
- iswspace() function in C++ STL
- iswupper() function in C++ STL
- iswxdigit() function in C++ STL

Advertisements