iswdigit() 함수는 C/C++의 내장 함수입니다. 와이드 문자가 십진수인지 여부를 확인합니다. C++ 언어에서는 "cwctype" 헤더 파일에 선언되고 C 언어에서는 "ctype.h"로 선언됩니다. 와이드 문자로 알려진 단일 문자가 필요합니다.
0에서 9까지의 문자는 십진수로 분류됩니다. 와이드 문자가 숫자가 아니면 영(0)을 반환합니다. 문자가 숫자이면 0이 아닌 값을 반환합니다.
다음은 C++ 언어의 iswdigit() 구문입니다.
int iswdigit(ch)
다음은 C++ 언어의 iswdigit() 예제입니다.
예시
#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;
} 출력
! , The character is not a digit 8 , The character is a digit