I read that stdint.h
is used for portability, but I'm confused.
If I wrote a program on a 32-bit system, uint32_t (unsigned int) is 4-bytes.
But when this program is run on 16-bit system, int is 2bytes and uint32_t (unsigned int) is 2bytes.
I think portability is not guaranteed in this case. Is there anything I am understanding wrong?
A
uint32_t
and auint16_t
are distinct types fromint
.While the size of
int
may vary, auint32_t
is always 32 bit and auint16_t
is always 16 bit.