int main()
{
if(sizeof(int)>-1)
printf("true");
else
printf("False");
return 0;
}
This Programm While Running Prints Out "False". Why Does This Happen? Even though it's Size was 4?
int main()
{
if(sizeof(int)>-1)
printf("true");
else
printf("False");
return 0;
}
This Programm While Running Prints Out "False". Why Does This Happen? Even though it's Size was 4?
the result of sizeof() is unsigned value while the right side of the comparison is signed. The compiler will convert the right side into unsigned (a very big number) first, then compare.