
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
iswdigit Function in C/C++
The function iswdigit() is a built-in function in C/C++. It checks whether the wide character is a decimal digit or not. 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.
The characters from 0 to 9 are classified as decimal digits. If the wide character is not a digit, it will return zero(0). If character is digit, it will return non-zero value.
Here is the syntax of iswdigit() in C++ language,
int iswdigit(ch)
Here is an example of iswdigit() in C++ language,
Example
#include <cwctype> #include <iostream> using namespace std; int main() { wchar_t c1 = '!'; wchar_t c2 = '8'; if (iswdigit(c1)) wcout << c1 << " , The character is a digit "; else wcout << c1 << " , The character is not a digit "; wcout << endl; if (iswdigit(c2)) wcout << c2 << ", The character is a digit "; else wcout << c2 << ", The character is not a digit "; return 0; }
Output
! , The character is not a digit 8 , The character is a digit
Advertisements