iswdigit() in C++

iswdigit(): This function is available in the file ctype.h. This function checks whether a wide character is a decimal digit or not. This function returns a value different from zero (i.e. true) if indeed c is a decimal digit. Zero (i.e. false) otherwise.

Parameters: One parameter is required for this function.

arg: A wide character to be checked, cast into wint_t.

Syntax:

int iswdigit(wint_t _C)

iswdigit(arg)

For Example:

iswdigit(L'9') = > It return true (any non-zero value).

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    wint_t C = L'9';

    cout << iswdigit(C<< "\n";

    return 0;
}


No comments:

Post a Comment