+ 2
Can anyone explain why no is printing
#include <stdio.h> int main() { if(sizeof(int) > -1){ printf("yes"); } else printf("no"); return 0; }
2 odpowiedzi
+ 5
Because sizeof returns an unsigned long long.
As a result -1 is converted to the unsigned long long equivalent, which is 2^64 - 1.
The size of an int is definitely smaller than that.
+ 3
Just like ~ swim ~ said in one of his answer and I still remember.
Try printing this line and see-
printf ("%lu", (long unsigned int)(-1));