iswpunct() in C++

iswpunct(): This function is available in the file ctype.h. This function checks whether a given wide character is a punctuation character or not. This function returns a value different from zero (i.e. true) if the character is a punctuation character. 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 iswpunct(wint_t _C)

iswpunct(arg)

For Example:

iswpunct(L'!') = > It return true (any non-zero value).

Approach

C++

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

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

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

    return 0;
}


No comments:

Post a Comment