
- 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
iswalpha() function in C++ STL
iswalpha() function in C++ STL is used to check whether the given wide character is an alphabet or not.
Algorithm
Begin Initializes the strings. Call function iswalpha(str) to check whether it contains alphabet or not. If it contains alphabet, then value will be returned otherwise zero will be returned. End
Example Code
#include <cwctype> #include <iostream> #include <cwchar> #include <clocale> using namespace std; int main() { setlocale(LC_ALL, "ab1234"); wchar_t s[] = L"a%$^^&)"; bool flag = 0; for (int i=0; i<wcslen(s); i++) { if (iswalpha(s[i])) { flag = 1; break; } } if (flag) wcout << s << L" contains alphabets"; else wcout << s << L" doesn't contain alphabets"; return 0; }
Output
a%$^^&) contains alphabets
- 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
- iswalnum() function in C++ STL
- lldiv() function in C++ STL
- negate function in C++ STL
- iswblank() function in C++ STL
- iswcntrl() function in C++ STL
- iswdigit() function in C++ STL
- iswlower() function in C++ STL

Advertisements