The range of values for the integer types in C++ is as follows:
-
short:
- Range: -32,768 to 32,767 (for signed short)
- Unsigned short range: 0 to 65,535
-
int:
- Range: -2,147,483,648 to 2,147,483,647 (for signed int)
- Unsigned int range: 0 to 4,294,967,295
-
long:
- Range:
- On 32-bit systems: -2,147,483,648 to 2,147,483,647 (same as int)
- On 64-bit systems: -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (for signed long)
- Unsigned long range:
- On 32-bit systems: 0 to 4,294,967,295
- On 64-bit systems: 0 to 18,446,744,073,709,551,615
- Range:
These ranges can vary based on the system architecture and whether the types are signed or unsigned.
