I wonder what is the greatest unsigned int value of 64 bit GCC on Linux. On 32 bit GCC, it's 4 294 967 295. I have only 32 bit machines so I can't check it.
Asked
Active
Viewed 3,821 times
-2
-
3You can check it on wikipedia: http://en.wikipedia.org/wiki/Integer_(computer_science) Signed: From −9,223,372,036,854,775,808 to 9,223,372,036,854,775,807, Unsigned: From 0 to 18,446,744,073,709,551,615 which equals 2^(64) − 1 – Szu Mar 17 '14 at 08:14
-
4[`std::numeric_limits
:max();`](http://en.cppreference.com/w/cpp/types/numeric_limits) - I wouldn't hard code it anywhere, use the standard solution! – Naszta Mar 17 '14 at 08:15 -
2`unsigned int` is most likely *still* 32 bits; you haven't specified the architecture or ABI. – Brett Hale Mar 17 '14 at 08:20
1 Answers
4
You could find out this value by using the macro UINT_MAX
, defined in limits.h
.

Lee Duhem
- 14,695
- 3
- 29
- 47