I keep hearing that the C primitive types (with the exception of char) are ill-defined and the sizes are not guaranteed. Obviously if I am trying to pack a transmission containing exactly 32-bits, then using unsignedint is unacceptable.
In what conditions will the definition of an unsignedint change? Is this:
A) Compiler defined,
B) Build environment defined,
C) Build target defined, or
D) Runtime enviornment defined? <-- This one is scary!
Can someone give an example of where an unsignedint is not 32 bits?
Ah great! I've seen people use int32_t but I never knew where it was defined. I thought it was some compiler's version of VS's __int32.
Since it's defined in cstdint in my implementation as typedefint int32_t; and is gaurunteed to be 32 bits, then I can conclude that this is compiler specific. That's good news because I was worried that the effects of my program would change if I tried it on some other machine.