The real difference between "int" and "unsigned int"

The Solution to The real difference between "int" and "unsigned int" is


Hehe. You have an implicit cast here, because you're telling printf what type to expect.

Try this on for size instead:

unsigned int x = 0xFFFFFFFF;
int y = 0xFFFFFFFF;

if (x < 0)
    printf("one\n");
else
    printf("two\n");
if (y < 0)
    printf("three\n");
else
    printf("four\n");

~ Answered on 2012-01-28 13:07:53


Most Viewed Questions: