Fixed width integer types
Fixed width integer types (since C++11) - cppreference.com
相关定义文件如下:
Windows系统MSVC:
Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\cstdint
Linux系统GCC:
gcc\libstdc++-v3\include\c_global\cstdint
以及相关的 gcc\libstdc++-v3\include\c_compatibility\stdint.h
通过整形字面语义后缀(int type literal suffix),简化定义形式,举例如下:
auto char_v = 17i8; // 8 bits, 1 byte
auto short_v = 17i16; // 16 bits, 2 bytes
auto int_v = 17i32; // 32 bits, 4bytes