[Solved] why is the garbage value for an integer so un-integerly huge [duplicate]


According to this answer, the minimum (emphasis mine) ranges of an integer is -32,767 to 32,767. The actual limits are implementation defined, and are most likely from -2 billion to positive 2 billion.

To check the integer limits on your device, you could use the header <limits> as follows:

int imin = std::numeric_limits<int>::min(); // minimum value
int imax = std::numeric_limits<int>::max(); //or INT_MAX

solved why is the garbage value for an integer so un-integerly huge [duplicate]