Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ispunct - Test for special character

&pagelevel(4)&pagelevel

Definition

#include <ctype.h>

int ispunct(c);

ispunct checks whether the character c is a special character, i.e. not a control, alphanumeric,
or white space character (see isspace).

Return val.

!= 0

0

c is a special character.

c is not a special character.

Note

ispunct is implemented both as a macro and as a function (see section “Functions and macros”).

Example

#include <ctype.h>
#include <stdio.h>
int main(void)
{
  int c;
  while((c = getchar()) != EOF)
    printf("%s : %c\n",((ispunct(c))? "Special character" : "Other"), c);
  return 0;
} 

See also

isalnum, isascii, iscntrl, isdigit, isgraph, islower, isalpha, isprint, isspace, isupper, isxdigit,
iswpunct