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

isalnum

Prototype

#include <ctype.h>

int isalnum(int c);

Description

Returns a true value for any character for which isalpha or isdigit is true.

Example

View source
#include <ctype.h>

/*
 * Return a true value if the argument string is a regular C
 * identifier.
 */
int is_identifier(const char *s)
{
    if (!isalpha(*s) && *s != '_')
	return 0;
    for (++s; *s != '\0'; ++s)
	if (!isalnum(*s) && *s != '_')
	    return 0;
    return 1;
}

References

ISO C 9899:1990 7.3.1.1