isalnum

Tests for an alphanumeric character (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:Character Manipulation

Syntax

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

Parameters

c
(IN) Specifies the character to be tested.

Return Values

This function or macro returns a value of 0 if the argument is neither an alphabetic character nor a digit. Otherwise, a nonzero value is returned.

Remarks

The isalnum function or macro tests if the argument c is an alphanumeric character (a to z, A to Z, or 0 to 9). An alphanumeric character is any character for which isalpha or isdigit is true.

See Also

isalpha, isdigit, islower

Example

  #include <ctype.h>  
  #include <stdio.h>  
  main ()  
  {  
     printf ("%d %d \w", isalnum (’Q’), isalnum (’!’));  
  }
  

produces the following:

  1 0