int
→ usually 4 bytesshort
, long
, long long
(different sizes)unsigned
versions → only positive valuesfloat
→ ~7 digits precisiondouble
→ ~15 digits precisionlong double
→ even higher precisionchar
→ 1 byte (stores a character or small integer)bool
→ true
or false
void
→ no value (mainly for functions with no return).signed
, unsigned
, short
, long
unsigned int
→ only positive (0 … 2³²−1 on 32-bit).long long
→ very large integers.sizeof(type)
→ tells how many bytes a type takes.
Example:
cout << sizeof(int); // usually 4