我发现在C99你应该#include <stdint.h>
,这似乎也适用于我的C ++ 03 gcc编译器,但它是现代C ++的正确标题,是否可移植?
答案 0 :(得分:14)
在C ++ 11中,它位于<cstdint>
。
在该语言的旧版本中,它并未正式存在;但许多编译器提供了C99库作为扩展,在这种情况下它将在<stdint.h>
中提供。
答案 1 :(得分:3)
在C ++中,标准标题位于cstdint
#include <cstdint>
答案 2 :(得分:2)
包括cinttypes
或cstdint
。
答案 3 :(得分:1)
它在stdint.h中定义:
#include <stdint.h>
答案 4 :(得分:0)
它在C99中,作为可选类型。许多C ++ 03编译器都提供该文件。它也在C ++ 11中,在那里它也是可选的,它引用了C99的定义。包括stdint.h