检查字符大小写

基本类型 / 字符类型

char c = 'a';

// ctype.h 函数接收 unsigned char 值,
// 以任意非零 int 表示“是”;bool 把它变成 1。
bool isUpper = isupper((unsigned char)c);
bool isLower = islower((unsigned char)c);
//isUpper is false
//isLower is true

printf("isUpper is %s\n", isUpper ? "true" : "false");
printf("isLower is %s\n", isLower ? "true" : "false");