This documentation is copyright © 1998-2001 Sandro Sigala <sandro@sigala.it>.
All rights reserved.

Released under the GNU General Public License.

Return to index Return to header Previous symbol Next symbol

ispunct

Prototype

#include <ctype.h>

int ispunct(int c);

Description

Returns a true value if the c character is a printing character neither a space character (' ') nor a character for which isalnum is true.

Example

View source
#include <ctype.h>

/*
 * Replace punctuation characters with spaces.
 */
char *replace_puncts(char *s)
{
    char *sp;
    for (sp = s; *sp != '\0'; ++sp)
	if (ispunct(*sp))
	    *sp = ' ';
    return s;
}

References

ISO C 9899:1990 7.3.1.8