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_tand auint16_tare distinct types fromint.While the size of
intmay vary, auint32_tis always 32 bit and auint16_tis always 16 bit.