Why does this code:
#include <iostream>
int main ()
{
int x = 1;
int y = ~x;
std::cout << y;
}
Always print -(x+1)? If x = 00000001, shoudn't y = 11111110?
That's because you're on a two's complement system. C++ doesn't guaratee that, but all (citation needed?) modern architectures have this property.