I don't know why the following code prints the same number. I expect it would give me some overflow error or something else.
int a = -2147483648;
int b = -a;
cout << a << "\t" << b << endl;
It prints -2147483648 -2147483648
.
I don't know why the following code prints the same number. I expect it would give me some overflow error or something else.
int a = -2147483648;
int b = -a;
cout << a << "\t" << b << endl;
It prints -2147483648 -2147483648
.