hi,
how the below code is generating out put as " -1 < ( unsigned char ) 1 ".
i read in many books saying when we do operation with singed and unsigned value always the resultant will be data type that has more width .
i understand that -1 when compared with unsigned should be coverted to unsigened int and yeild a big value than 1.
but the out put is different.
whats the story..
please help.
main() {
if ( -1 < (unsigned char) 1 )
printf("-1 is less than (unsigned char) 1");
else
printf("-1 NOT less than (unsigned char) 1");
}