In Visual Studio 14
the stdint.h
header has definitions for fixed width integer types, but if you actually look at there definitions they just delegate back to primitives. The definitons are as follows:
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
So is there any reason to use stdint.h
if all it does is just fallback to primitives? I also know that Visual Studio does not just replace these definitions at compile time because if you try to print out an int8_t
to the console you will get a Unicode character instead of a number because it is really just a signed char
.
EDIT
Because people are pointing out that there is nothing else that they would logically define to I think my question needs restating.
Why is it that the header which in the C++ spec states that it will have integers of a fixed length of 8, 16, 32 and 64 bits define these integers as types which by definition can be any size the compiler wants (to put in a way said by someone else in another question The compiler can decide that an int will a 71 bit number stored in a 128 bit memory space where the additional 57 bits are used to store the programmers girlfriends birthday.
)?