当前位置: C语言 -- 标准库 -- <stdint.h> -- UINT_FASTN_WIDTH

UINT_FASTN_WIDTH宏


概要:
#include <stdint.h>
#define UINT_FASTN_WIDTH N

描述:

该宏表示最小宽度为N的最快无符号整数类型的宽度,即uint_fastN_t类型的宽度。

该宏应替换为适合在#if预处理指令中使用的常量表达式,其实现定义值大于等于N。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
/*宏UINT_FASTN_WIDTH范例*/

#include <stdint.h>
#include <stdio.h>

int main(void)
{
    printf("UINT_FAST8_WIDTH = %d\n", UINT_FAST8_WIDTH);
    printf("UINT_FAST16_WIDTH = %d\n", UINT_FAST16_WIDTH);
    printf("UINT_FAST32_WIDTH = %d\n", UINT_FAST32_WIDTH);
    printf("UINT_FAST64_WIDTH = %d\n", UINT_FAST64_WIDTH);

    return 0;
}


可能输出:

UINT_FAST8_WIDTH = 8

UINT_FAST16_WIDTH = 16

UINT_FAST32_WIDTH = 32

UINT_FAST64_WIDTH = 64

(注:编译时实现未定义宏UINT_FAST8_WIDTH、UINT_FAST16_WIDTH、UINT_FAST32_WIDTH、UINT_FAST64_WIDTH。)


相关内容:
INT_FASTN_WIDTH 表示最小宽度为N的最快有符号整数类型宽度的宏。


主要参考资料:

1、ISO/IEC 9899:2024