isalnum


isalnum

Ascertains whether a given character is alphanumeric

 #include <ctype.h> int isalnum ( int c  ); 

The function isalnum( ) tests whether its character argument is alphanumeric; that is, whether the character is either a letter of the alphabet or a digit. In other words, isalnum( ) is true for all characters for which either isalpha( ) or isdigit( ) is true.

Which characters are considered alphabetic or numeric depends on the current locale setting for the localization category LC_CTYPE, which you can query or change using the setlocale( ) function.

If the character is alphanumeric, isalnum( ) returns a nonzero value (that is, true); if not, the function returns 0 (false).

Example

See the example for isprint( ) in this chapter.

See Also

isalpha( ), isblank( ), iscntrl( ), isdigit( ), isgraph( ), islower( ), isprint( ), ispunct( ), isspace( ), isupper( ), isxdigit( ); the corresponding C99 function for wide characters, iswalnum( ); setlocale( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net