字符函数 - isalpha

原型:extern int isalpha(int c);

用法:#include <ctype.h>

功能:判断字符c是否为英文字母

说明:当c为英文字母a-z或A-Z时,返回非零值,否则返回零

举例:
    // isalpha.c
    
    #include <syslib.h>
    #include <ctype.h>
    #include <stdio.h>

    main()
    {
      int c;
      
      clrscr();        // clear screen
      printf("Press a key");
      for(;;)
      {
        c=getchar();
        clrscr();
        printf("%c: %s letter",c,isalpha(c)?"is":"not");
      }
      return 0;	// just to avoid warnings by compiler
    }
相关函数:isalnum,isdigit,isxdigit,iscntrl,isgraph,isprint,ispunct,isspace