#C 语言标准库宏 UINT32_C
下面以函数形式说明宏的调用接口。
#include <stdint.h>
integer_constant UINT32_C(value);
说明
为 uint_least32_t 对应的整数类型构造常量表达式。
展开形式取决于实现。需要带负号的常量时,可在有符号宏的调用表达式外应用一元负号。
自 C99 起提供。
参数
value- 无后缀的非负整数常量,数值须能以对应类型表示。
返回值
- 整数常量表达式,可用于预处理整数条件。结果类型为 uint_least32_t 经整数提升后的类型。
#示例
#include <stdint.h>
#include <stdio.h>
int main(void)
{
uint_least32_t number = UINT32_C(42);
printf("%ju\n", (uintmax_t)number);
return 0;
}
运行结果。
42