#include<iostream>
#include<limits>
usingnamespace std;
int main()
{
shortint i;
shortunsignedint j;
j=50000;
i=j;
std::cout << "Minimum value for short int: " << std::numeric_limits<shortint>::min() << '\n';
std::cout << "Maximum value for short int: " << std::numeric_limits<shortint>::max() << '\n';
std::cout << "Minimum value for short unsigned int: " << std::numeric_limits<shortunsignedint>::min() << '\n';
std::cout << "Maximum value for short unsigned int: " << std::numeric_limits<shortunsignedint>::max() << '\n';
cout <<i<<" "<<j;
system("pause");
return 0;
}
Minimum value for short int: -32768
Maximum value for short int: 32767
Minimum value for short unsigned int: 0
Maximum value for short unsigned int: 65535
-15536 50000
What you have is the same bit combination interpreted with a sign and without