#include <iostream>
using namespace std;
int main()
{
unsigned int x = 0;
cout << x - 1;
return 0;
}
The following code demonstrates printing, 4294967295
. However, maybe I am forgetting math here but,
0
+ -1
should be 0000 0000 0000 0000 0000 0000 0000 0000 (0)
+ 1111 1111 1111 1111 1111 1111 1111 1111 (-1)
, however how does this then map to 1000 0000 0000 0000 0000 0000 0000 0000 (4294967295)