I would like char, short and int types to be 1, 2 and 4 bytes width. I have included a stdint.h header into my sources. Does this guarantee that int8_t, int16_t and int32_t integer types will be of widths specified? What is the best way to achieve this?
If these types exist, they have the correct width and are encoded in two's complement.
Edit: you should be able to check if the types exist with something like
#ifdef INT32_MAX
...
#endif
but on all end user architectures (PC etc) these types do usually exist.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With