Size of Data Types in C/C++

Created Thursday 05 May 2016

Data Type Memory Used (Bytes)
bool 1
char 1
short 2
int 4
float 4
double 8

For 32-bit systems, the 'de facto' standard is ILP32 — that is, int, long and pointer are all 32-bit quantities.

For 64-bit systems, the primary Unix 'de facto' standard is LP64 — long and pointer are 64-bit (but int is 32-bit). The Windows 64-bit standard is LLP64 — long long and pointer are 64-bit (but long and int are both 32-bit).

Backlinks: index:CS225 Notes:Topics