I would like to know if Microsoft Visual Studio 2010 supports C99. If not, how can I use the standard types like intptr_t
and uintptr_t
?
-
possible duplicate of [Visual Studio support for new C / C++ standards?](http://stackoverflow.com/questions/146381/visual-studio-support-for-new-c-c-standards) – Mitch Wheat Jul 14 '11 at 05:44
-
1That's the 2008 edition, so not an exact duplicate. – Bo Persson Jul 14 '11 at 15:49
-
http://herbsutter.com/2012/05/03/reader-qa-what-about-vc-and-c99/ pretty much says everything there is to say on the subject. – Stephen Canon Jan 23 '13 at 11:48
-
1Looks like we're going to have [C99 library support in Visual Studio **2013**](http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx)! – Lumi Jul 26 '13 at 13:02
3 Answers
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.

- 347
- 3
- 12
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?

- 1
- 1

- 84,103
- 24
- 152
- 189
-
What about the printing factor I use? In C99 **zd** works fine for both **32 bit and 64 bit** environment. – thetna Jul 14 '11 at 05:49
-
-
1
-
3Just make sure to pick the real type, rather than the "signed short" placeholder in the example. – Jon Hess Jun 04 '12 at 19:38
-
@thetna That's not called a "printing factor", it's called a "conversion specifier". – Jun 30 '13 at 08:13
-
It doesn't implement all of C99, but MSVC 2010 *does* have intptr_t: http://msdn.microsoft.com/en-us/library/323b6b3k%28v=vs.100%29.aspx – rdb Oct 21 '14 at 17:22
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).

- 333,147
- 50
- 533
- 760