[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
ispunct() Test for Punctuation Character
#include <ctype.h>
int ispunct(c);
int c; Integer value to be tested
ispunct() tests if 'c' is a punctuation character. A punctuation
character is one that is not alphabetic, not numeric, not a control
character, and not a white space.
Returns: True (nonzero) if the integer satisfies the test
condition or false (zero) if it does not. The result is
undefined if 'c' is other than an ASCII character or EOF.
Notes: ispunct() is a macro.
-------------------------------- Example ---------------------------------
The following statements print out the contents of a string, putting
in a new-line character after each punctuation character.
#include <ctype.h>
char *buffer;
int c;
int x;
main()
{
buffer = "If you go down to the woods today...";
for (x = 0; x < strlen(buffer); x++)
if (ispunct(buffer[x])) {
fputchar(buffer[x]);
fputchar('\n');
}
else if (isprint(buffer[x]))
fputchar(buffer[x]);
}
See Also:
isalnum()
isascii()
iscntrl()
isdigit()
isgraph()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson