Here is very simple code,
#include using namespace std; int main() { unsigned int u=10; int i; int count=0; for (i=-1;i<=
Its because -1 is casted as an unsigned int, so the for loop code is never executed.
Try compiling with -Wall -Wextra so you can get the respective warnings (if not getting them so far, and compiling with g++)
http://en.wikipedia.org/wiki/Two's_complement