12

Possible Duplicate:
Visual Studio support for new C / C++ standards?

See the text below from wiki:

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:

My visual studio can not find any of this files:

  1. <cstdint>
  2. <cinttypes>
  3. <stdint.h>
  4. <inttypes.h>

Why?

Community
  • 1
  • 1
Narek
  • 38,779
  • 79
  • 233
  • 389
  • As you noted that's C99. I don't believe VS claims C99 support. – Mat Oct 19 '12 at 08:36
  • I don't think this is a dup since your question was very specific, and it was not addressed in the cited dup. – jww Oct 01 '16 at 08:37
  • Early Microsoft compilers, like Visual Studio .Net 2003, used `` rather than ``. You can follow the locations of types like `uintptr_t` and `ptrdiff_t` at [Standard Types](https://msdn.microsoft.com/en-us/library/323b6b3k(v=vs.71).aspx) on MSDN. The page covers VS2003 through VS2015. – jww Oct 01 '16 at 08:38

1 Answers1

15

EDIT

Note that starting from Visual Studio 2013, C99 library support has been added to Visual Studio.

The answer below is my old answer before Visual Studio 2013 added support:


MSVC has very poor support for the C language, they do not support anything past C90. Herb Sutter has already publicly stated this in his blog.

<cstdint> is supported from MSVC2012.

There is a msinttypes project (exported from the original repo on Google Code) that fills the absence of stdint.h and inttypes.h in Microsoft Visual Studio.

Boost also provides boost/cstdint.hpp if you do not have it.

Stelio Kontos
  • 424
  • 3
  • 14
Jesse Good
  • 50,901
  • 14
  • 124
  • 166
  • 5
    Visual Studio 2013 (12.0) has stdint.h and inttypes.h – David Grayson Sep 24 '15 at 15:29
  • 2
    Yes, that was announced in [July 2013](http://blogs.msdn.com/b/vcblog/archive/2013/07/19/c99-library-support-in-visual-studio-2013.aspx). I posted this answer in October 2012. – Jesse Good Sep 25 '15 at 11:43
  • @JesseGood As your answer is the (only and) accepted one *and* search machines point to this question: Do you mind editing the updated information into your old post? – Simon Sobisch Sep 18 '18 at 21:03