1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
/* isxdigit example */
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int main ()
{
char str[]="ffff";
long int number;
if (isxdigit(str[0]))
{
number = strtol (str,NULL,16);
printf ("The hexadecimal number %lx is %ld.\n",number,number);
}
return 0;
}
|