1. 原型:extern int isdigit(int c);
    2. 用法:#include <ctype.h>
    3. 功能:判断字符c是否为数字
    4. 说明:当c为数字0-9时,返回非零值,否则返回零。
    5. 举例:
    6. // isdigit.c
    7. #include <stdio.h>
    8. #include <ctype.h>
    9. main()
    10. {
    11. int c;
    12. clrscr(); // clear screen
    13. c='a';
    14. printf("%c:%s\n",c,isdigit(c)?"yes":"no");
    15. c='9';
    16. printf("%c:%s\n",c,isdigit(c)?"yes":"no");
    17. c='*';
    18. printf("%c:%s\n",c,isdigit(c)?"yes":"no");
    19. getchar();
    20. return 0;
    21. }