C++: max integer [duplicate]

In the C++ standard library header <limits>, you will find:

std::numeric_limits<int>::max()

Which will tell you the maximum value that can be stored in a variable of type int. numeric_limits is a class template, and you can pass it any of the numeric types to get the maximum value that they can hold.

The numeric_limits class template has a lot of other information about numeric types as well.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)