Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

isalnum - Test for letter or digit

&pagelevel(4)&pagelevel

Definition

#include <ctype.h>

int isalnum(int c);

isalnum checks whether the character c from the EBCDIC character set is alphanumeric,
i.e. a letter (A-Z, a-z) or a digit (0-9).

Return val.

!= 0

0

c is alphanumeric.

c is not alphanumeric.

Note

isalnum is implemented both as a macro and as a function (see section “Functions and macros”).

Example

#include <ctype.h>
#include <stdio.h>
int main(void)
{
  int c;
  while((c = getchar()) != EOF)
     printf("%s : %c\n", ((isalnum(c)) ? "Alphanumeric" : "Other"), c);
  return 0;
} 

See also

isalpha, isascii, iscntrl, isdigit, isgraph, islower, ispunct, isprint, isspace, isupper, isxdigit,
isebcdic, iswalnum