Check if wide character is punctuation character
Checks whether c is a punctuation character.
A puctuation character is a character considered by a specific locale as a punctuation mark. These are characters with a graphical representation (as in iswgraph) that are necessarily non-alphanumerical (as in iswalnum).
This function is the wide-character equivalent of ispunct (<cctype>): If c translates with wctob to a character for which ispunct is true, it is always considered a punctuation character by this function (except possibly for certain locale-specific printable white-space characters other than L' ').
In C++, a locale-specific template version of this function (ispunct) exists in header <locale> for all character types.
- Wide character to be checked, casted to a wint_t, or WEOF.
wint_t is an integral type.
A value different from zero (i.e., true) if indeed c is a punctuation character. Zero (i.e., false) otherwise.
/* iswpunct example */
int main ()
wchar_t str = L"Hello, welcome!";
if (iswpunct(str[i])) cx++;
wprintf (L"The sentence contains %d punctuation characters.\n", cx);
The sentence contains 2 puntuation characters.
- Check if character is a punctuation character (function
- Check if wide character has graphical representation (function
- Check if wide character is a control character (function
- ispunct (locale)
- Check if character is a punctuation character using locale (function template)