vc6 中
#include <stdint.h>
报错,提示找不到。 解法是 去掉,手动定义 uint8_t 等 或者使用下面 msinttypes提供的文件
The C99 standard includes definitions of several new integer types to enhance the portability of programs[2]. The already available basic integer types were deemed insufficient, because their actual sizes are implementation defined and may vary across different systems. The new types are especially useful in embedded environments where hardware supports usually only several types and that support varies from system to system. All new types are defined in inttypes.h header (cinttypes header in C++) and also are available at stdint.h header (cstdint header in C++). The types can be grouped into the following categories:
翻译就是:C99包括一些新的整型的定义,已经有的一些整型的定义是不够的,因为他们的真实尺寸可能在不同的系统上有所不同。新定义的类型尤其在嵌入式环境中有用。所有的新类型定义在 inttypes.h (C++是 cinttypes) 中,也可以通过 stdint.h (c+++是 cstdint ) 去访问
有一个项目 msinttypes 提供 VS所缺失的 stdint.h 和 inttypes.h 等文件
MSVC是不支持C99 的, Herb Sutter 在他的博客上
(http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/) 说了。
简言之就是 Visual C++ 的重点是支持 被 ISO C90 或者 ISO C++(98 或11) 支持的ISO C 代码
MSVC所支持 C99/C11 只是 ISO C++98/C++11的一个子集,所以是支持大部分C99的,但不是全部的
从VC++ 2010开始就完全支持C++98中 C的子集,包括< stdint.h > 和在块中间声明等
为了保持向后兼容,所以提供一个C90的编译器,只接受C90 而不是C++
他们也没有计划支持 那些 不是C90或ISO C++一部分的 ISO C的特性
该博客讨论了在VC6中遇到的stdint.h头文件缺失的问题,指出VC++并不完全支持C99标准,而是专注于C90和C++98/11。解决方案包括手动定义uint8_t等类型或使用第三方库msinttypes。文章还提到从VC++ 2010开始支持C++98中的C子集,但不包含所有C99特性。
1287

被折叠的 条评论
为什么被折叠?



