unsigned int x;
x = 0;
x = x - 1; // x now contains 65535 - rolls over in neg. direction
Bear in mind that is only true when sizeof(x) == 2.
unsigned int x;
x = 0;
x = x - 1; // x now contains 65535 - rolls over in neg. direction
Bear in mind that is only true when sizeof(x) == 2.