Name
ispunct
Synopsis
Ascertains whether a given character is a punctuation mark
#include <ctype.h> intispunct( intc);
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).
Example
See the example for isprint() in this
chapter.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access