Previous Page
Next Page


Ascertains whether a given character is a punctuation mark

#include <ctype.h>
int ispunct ( int c  );

The function ispunct( ) tests whether its character argument is a punctuation mark. If the character is a punctuation mark, ispunct( ) returns a nonzero value (that is, TRue); if not, the function returns 0 (false).

The punctuation characters are dependent on the current locale setting for the category LC_CTYPE, which you can query or change using the setlocale( ) function. In the default locale C, the punctuation characters are all of the graphic characters (those for which isgraph( ) is true), except the alphanumeric characters (those for which isalnum( ) is true).


See the example for isprint( ) in this chapter.

See Also

The corresponding C99 function for wide characters, iswpunct( ); isalnum( ), isalpha( ), isblank( ), iscntrl( ), isdigit( ), isgraph( ), islower( ), isprint( ), isspace( ), isupper( ), isxdigit( )

Previous Page
Next Page