#include Home >
Article > Backend Development > In C/C++, the function of iswpunct() function is to determine whether a wide character is a punctuation mark. The function iswpunct() is used to check whether the passed wide character is a punctuation mark. If it is not a punctuation mark, zero is returned, otherwise a non-zero value is returned. It is declared in the "cwctype" header file. The following is the syntax of iswpunct(): This is an example of iswpunct() In the above program, two wide characters are declared as a and b. Checks whether the passed characters are punctuation marks. The above is the detailed content of In C/C++, the function of iswpunct() function is to determine whether a wide character is a punctuation mark.. For more information, please follow other related articles on the PHP Chinese website!In C/C++, the function of iswpunct() function is to determine whether a wide character is a punctuation mark.
int iswpunct(wint_t character);
Example
#include<cwctype>
#include<stdio.h>
using namespace std;
int main() {
wint_t a = '!';
wint_t b = 'a';
if(iswpunct(a))
printf("The character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\nThe character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
return 0;
}
Output
The character is a punctuation.
The character is not a punctuation.
wint_t a = '!';
wint_t b = 'a';
if(iswpunct(a))
printf("The character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
if(iswpunct(b))
printf("\nThe character is a punctuation.");
else
printf("\nThe character is not a punctuation.");
Related articles
See more