#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#define MAX_PATH 256
char filename[MAX_PATH + 5];
int isdigit(int c)
{
if (c >= '0' && c <= '9')
return 1;
return 0;
}
int main(int argc, char** argv)
{
int kk1 = '0';
printf("shuzu : %d \n", kk1); //打印 : 48
int kk0 = '3';
printf("shuzu : %d \n", kk0); //打印: 51
int kk2 = 'b';
printf("shuzu : %d \n", kk2); //打印 : 98
int kk3 = '3' - '0';
printf("shuzu : %d \n", kk3); //打印 : 3
int kk4 = 'b'-'3';
printf("shuzu : %d \n", kk4); //打印 : 47
if (isdigit('5')) {
printf("true");
}
else {
printf("false");
}
getchar();
return 0;
}
FR:徐海涛(hunkxu)