stdint.h defines integer types with specified width. When should we use those types, for example, uint32_t instead of unsigned int? Is it because we can obtain desired types without considering the underlying machine?
stdint.h defines integer types with specified width. When should we use those types, for
Share
When you need to communicate with other systems and you want to be sure of the length of the data.
For example: you save your number to disk. How much long is it on disk? With an
unsigned intthe response is “it depends on the compiler, the OS…”. Withuint32_tit is 32 bits (4 bytes on “standard” architectures).