isalphanum(3C)
_________________________________________________________________
isalphanum macro
Determine if a character is alphanumeric.
_________________________________________________________________
Calling Sequence
#include <ctype.h>
int c, result;
result = isalphanum(c);
Description
Use the isalphanum macro to determine if a character is
alphabetic or numeric. The isalphanum macro 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.
Returns
The isalphanum macro returns a nonzero value if the character is
alphanumeric; otherwise, it returns 0.
Related Functions
See also the isalnum, isalpha, and isdigit macros.
Example
/* 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",
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
isalphanum(3C)
(result = isalphanum(argv[i][0])) == 0 ? "No" : "Yes");
i++;
}
}
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.
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)