标签:
函数模拟源码:
int isxdigit(int c) { return ('0' <= c && c <= '9') || ('A' <= c && c <= 'F') || ('a' <= c && c <= 'f'); }
#include <stdio.h> #include <ctype.h> main() { char str[]="a3 4%8}9 [e*&^%?"; int i = 0; for(i=0;str[i]!=0;i++) { if(isxdigit(str[i])) { printf("%c 是十六进制数\n",str[i]); } else { printf("%c 不是十六进制数\n",str[i]); } } }
标签:
原文地址:http://blog.csdn.net/kongshuai19900505/article/details/51549606