Does Microsoft visual studio 2010 support c99?

与世无争的帅哥 提交于 2019-11-27 05:16:45
David Grayson

As far as I can tell, Visual Studio 2010 does not support C99. To use types from stdint.h, you will have to use a typedef. A cross-platform way to do this would be:

#ifdef _WIN32
typedef signed short int16_t
#else
#include <stdint.h>
#endif

See also this this question: Visual Studio support for new C / C++ standards?

Visual Studio 2010 does not support C99 syntax. stdint.h is a very common file in all C/C++ compilers, though, which does exist in a Visual C++ 10.0 installation, included with the Windows SDK (regardless of the version of Visual Studio that you use).

stdint.h can be found in:

  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\

This file does provide a typedef for intptr_t. Feel free to use it in any C or C++ project you like.

Microsoft C does not support C99. However, MSVC 16 (what's provided with Visual Studio 2010) implements a good portion of the upcoming C++0x standard. C++0x is incorporating some of the headers from C99, such as stdint.h and inttypes.h - that's why you get some tidbits of C99 with MSVC 16.

Be thankful for small things (I wish MSVC supported a bit more of C99 when compiling straight C files).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!