What is the size of int, long type in C++ standard?

C++Server Side ProgrammingProgramming

The C++ standard does not specify the size of integral types in bytes. It specifies the minimum range these types must be able to hold.

The size in bits can be easily found from the specified minimum range.

Not referring to the standard but the commonly used sizes for various platforms are −

  • For 32-bit systems, the standard is ILP32 — that is, int, long and pointer are all 32-bit quantities.
  • For 64-bit systems, the Unix standard is LP64 — long and pointer are 64-bit (but int is 32-bit). The Windows 64-bit standard is LLP64 — long and pointer are 64-bit (but long and int are both 32-bit).
Published on 28-Feb-2018 13:04:35