Watched a course by
C++ on Coursera and there they said that you can connect the
CSTDLIB library and use type data types:
int16_t, uint16_t, int64_t, uint64_t , etc. Recently I learned that in the pros and how to write just
Short Int, Long int , etc.
Question Actually is that there is the difference between them or is this one and the same?
Answer 1, Authority 100%
depending on the compiler and the system that you compile, the size of the built-in types (
long , etc. ., In contrast,
uintxx_t ) may differ.
In the standard (or somewhere else) you can read, in what limits the dimensions of these types may vary, but in practice, usually
Short – 2 bytes,
int – 4 ,
long – 4 or 8,
Long Long – 8.
uintxx_t , obviously, the size is always the same.
Answer 2, Authority 44%
short int and
Long int – standard language types of dimensions of at least 16 and at least 32, respectively.
int32_t – optionally supported aliases of types from the standard dimension library exactly 16 and exactly 32, respectively.
By the way,
char32_t belong to the first type (i.e., keywords for non-fixed size), despite the name .