Name

iswpunct

Synopsis

Ascertains whether a given wide character is a punctuation mark

#include <wctype.h>
intiswpunct( wint_t wc );

The iswpunct() function is the wide-character version of the ispunct() character classification function. It tests whether its wide character argument is a punctuation mark. If the argument represents a punctuation mark, iswpunct() returns a nonzero value (that is, true); if not, the function returns 0 (false).

Which characters represent punctuation marks depends on the current locale setting for the category LC_CTYPE, which you can query or change using the setlocale() function. For all locale-specific punctuation characters, both iswspace() and iswalnum() return false.

If the wide character is not the space character L' ', but is both a printing and a whitespace character—that is, both iswprint(wc) and iswspace(wc) return true—then the function call iswpunct(wc) may yield a different value than the corresponding byte-character function call ispunct(wctob(wc)).

Example

See the example for iswalpha() in this chapter.

See Also

The corresponding function for byte characters, ispunct(); iswalnum(), iswalpha(), iswblank(), iswcntrl(), iswdigit(), iswgraph(), iswlower(), iswprint(), iswspace(), iswupper(), iswxdigit(), setlocale(); the extensible wide-character classification function, iswctype()

Get C in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.