| Sizeof Operator |
char signed char unsigned char
Plain char is the same as one of the others.
short int int long int long long int
signed short int signed int signed long int
signed long long int
Plain is the same as signed.
unsigned short int unsigned int unsigned long int unsigned long long int
Basic Floating Types
float double long double
Abbreviations
short long long long
Sizes of Basic Integer Types
| Minimum Size | Typical Size | |||
| Type | (bytes) | (bytes) | ||
| char | 1 | 1 | ||
| short | 2 | 2 | ||
| int | 2 | 4 | ||
| long | 4 | 4 | ||
| long long | 8 | 8 | ||
| float | 4 | 4 | ||
| double | 8 | 8 | ||
| long double | 8 | 12 |
The long long type is part of the C standard, not C++, but compilers will often support it anyway.
Use sizeof to find the size of a type.
| Sizeof Operator |