SignedUnsigned32-bit64-bit
C declarationC declarationBytesBytes
[signed] charunsigned char11
shortunsigned short22
intunsigned44
longunsigned long48
int32_tuint32_t44
int64_tuint64_t88
char *48
float44
double88

Observation

  • The size of an object changes with the word size of the processor where the program is run.
  • Using fixed size integer types like int32_t and int64_t is the best way to have close control over data representation regardless of the processor the compiler is run.

Ranges of various C data types

32-bit programs

64-bit programs

Sources