isalphanum(3C) DG/UX R4.11MU05 isalphanum(3C)
NAME
isalphanum - determine if a character is alphanumeric
SYNOPSIS
#include <ctype.h>
int c, result;
...
result = isalphanum(c);
DESCRIPTION
Use the isalphanum macro to determine whether a character is
alphabetic or numeric. isalphanum is the same as isalnum.
Alphabetics are A-Z and a-z; numerics are 0-9.
Do not try to redeclare this macro or you might get unexpected
results.
Return Value
The isalphanum macro returns a nonzero value if the character is
alphanumeric; otherwise, it returns 0.
EXAMPLES
/* Program test for the isalphanum() macro */
#include <ctype.h>
#include <stdio.h>
int i = 1, result;
main(argc, argv)
int argc;
char *argv[];
{
while (i < argc) {
printf("Is character %c alphanumeric? ", argv[i][0]);
printf("%s.\n", (result = isalphanum(argv[i][0])) == 0 ? "No" : "Yes");
i++;
}
return 0;
}
A call to the program test with the characters &, 7, \, and g
generates the output
Is character & alphanumeric? No.
Is character 7 alphanumeric? Yes.
Is character \ alphanumeric? No.
Is character g alphanumeric? Yes.
SEE ALSO
ishex(3C), isnan(3C).
Licensed material--property of copyright holder(s)