
- 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
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
- Related Articles
- iswdigit() function in C++ STL
- 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++
- towupper() function in C/C++
- mbrtowc() function in C/C++
- Rename function in C/C++

Advertisements