代码点读机 / C / ctype.h

ctype.h C · 头文件

C 字符处理头文件,包含判断字符类别和大小写转换的函数。

怎么用

#include <ctype.h>

小例子

#include <stdio.h>
#include <ctype.h>
int main(void) {
    printf("%d", isdigit('5'));
    return 0;
}

运行结果

输出非 0(表示是数字字符)

提醒:isdigit、isalpha、isspace、toupper、tolower 等都在这里

官方文档:https://en.cppreference.com/w/c/string/byte

在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← C全部词条