0

What exactly the maximum and the minimum value of any definition type? Is this possible?

unsigned int maximum_uint = (maximum_value)(unsigned int);
short minimum_short = (minimum_value)(short);
float maximum_float = (maximum_value)(float);
Cœur
  • 37,241
  • 25
  • 195
  • 267

2 Answers2

2

What you have written is probably not possible.

The limits of various types are provided in the C-style C++ header climits and some in the C++ header limits

See :

climits

limits

asheeshr
  • 4,088
  • 6
  • 31
  • 50
2
#include <limits>

unsigned int maximum_uint = std::numeric_limits<unsigned int>::max();
short minimum_short = std::numeric_limits<short>::min();
float maximum_float = std::numeric_limits<float>::max();
Marius Bancila
  • 16,053
  • 9
  • 49
  • 91