代码点读机 / C / stdint.h

stdint.h C · 头文件

C99 固定宽度整数头文件,提供 int32_t、uint64_t 等大小确定的类型。

怎么用

#include <stdint.h>

小例子

#include <stdio.h>
#include <stdint.h>
int main(void) {
    int32_t x = 100;
    printf("%d", x);
    return 0;
}

运行结果

输出 100

提醒:需要精确控制整数大小时用它,比 long/long long 更可移植

官方文档:https://en.cppreference.com/w/c/types/integer

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