isalnum

Header: <ctype.h>

Checks if the given character is an alphanumeric character as classified by the current C locale. In the default locale, the following characters are alphanumeric:

# Declarations

int isalnum( int ch );

# Parameters

# Return value

Non-zero value if the character is an alphanumeric character, 0 otherwise.

# Example

#include <ctype.h>
#include <locale.h>
#include <stdio.h>
 
int main(void)
{
    unsigned char c = '\xdf'; // German letter ß in ISO-8859-1
 
    printf("isalnum('\\xdf') in default C locale returned %d\n", !!isalnum(c));
 
    if (setlocale(LC_CTYPE, "de_DE.iso88591"))
        printf("isalnum('\\xdf') in ISO-8859-1 locale returned %d\n", !!isalnum(c));
}

# See also