为什么可以找到stdint.h但cstdint不行?

van*_*van 7 c++ g++ acc stdint

我很惊讶,包括stdint.h工作,但不包括cstdint.

$ aCC sizeof.cpp
"sizeof.cpp", line 5: error #2005-D: could not open source file "cstdint"
  #include <cstdint>
                    ^

1 error detected in the compilation of "sizeof.cpp".
$ aCC --version
aCC: HP C/aC++ B3910B A.06.12 [Nov 03 2006]
Run Code Online (Sandbox Code Playgroud)

它与g ++相同:

$ g++ --version
g++ (GCC) 4.2.3
Run Code Online (Sandbox Code Playgroud)

我可以问为什么?并且,有任何方法来解决这个问题,但更新编译器?谢谢.

CB *_*ley 7

您的编译器支持没有的旧C++标准<cstdint>(因为C90没有<stdint.h>).<cstdint>是C++ 11的新手.

  • @van:就是这样.C++ 03引用的C标准版本(因为它只是对C++ 98的一个小更新)仍然是C90. (2认同)