S
suresh
Hi,
For this code snippet, I get the following output, which I am unable
to understand.
(2^31 = 2147483648)
cout<< -2147483648 << endl;
cout << numeric_limits<int>::min() <<',' <<
numeric_limits<int>::max()<< endl;
The outputs I get are:
2147483648
-2147483648,2147483647
with this compile time warning: this decimal constant is unsigned only
in ISO C90
I am surprised why the negative number is printed as positive.
Could you please explain why this behaviour?
thanks
suresh
For this code snippet, I get the following output, which I am unable
to understand.
(2^31 = 2147483648)
cout<< -2147483648 << endl;
cout << numeric_limits<int>::min() <<',' <<
numeric_limits<int>::max()<< endl;
The outputs I get are:
2147483648
-2147483648,2147483647
with this compile time warning: this decimal constant is unsigned only
in ISO C90
I am surprised why the negative number is printed as positive.
Could you please explain why this behaviour?
thanks
suresh