Question

I found that in C99 you should #include <stdint.h> and that seems to work with my C++03 gcc compiler too, but is that the right header for modern C++, is it portable?

Was it helpful?

Solution

In C++11, it's in <cstdint>.

In older versions of the language, it didn't officially exist; but many compilers provided the C99 library as an extension, in which case it would be available in <stdint.h>.

OTHER TIPS

It is defined in stdint.h:

#include <stdint.h>

In C++, the standard header is in cstdint

#include <cstdint>

Include either cinttypes or cstdint.

It's in C99, in , as an optional type. Many C++03 compilers do provide that file. It's also in C++11, in , where again it is optional, and which refers to C99 for the definition. include stdint.h

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top