stdint.h
和 cstdint
有什么不同?
它们都可以在 MSVC (Visual Studio 2010)和 gcc-4.5.1中找到。两者都定义了 intX_t
/uintX_t
类型(其中 X
是该类型的大小(以字节为单位)。
stdint.h
定义没有任何命名空间的每个类型,cstdint
类型位于 std
命名空间中。
std
命名空间中?这两个头有什么不同?cstdint
没有文件扩展名,使用 c
前缀,stdint.h
使用 .h
扩展名。
c
前缀表示这是一个 C 库?为什么 cstdint
没有文件扩展名?