Are there other integer types?

0146

Yes, in addition to short, int, and long, C++ provides several other integer types:

  1. long long: Typically uses 8 bytes (64 bits) and is guaranteed to be at least as large as long.

  2. unsigned short: A variant of short that can only represent non-negative values, typically using 2 bytes.

  3. unsigned int: A variant of int that can only represent non-negative values, typically using 4 bytes.

  4. unsigned long: A variant of long that can only represent non-negative values, typically using either 4 or 8 bytes.

  5. unsigned long long: A variant of long long that can only represent non-negative values, typically using 8 bytes.

These unsigned types allow for a greater positive range since they do not need to account for negative values.

0 Comments

no data
Be the first to share your comment!