Possible Duplicate:
Why does sizeof(x++) not increment x?
#include<stdio.h>
int main(void)
{
double num=5.2;
int var=5;
printf("%d\t",sizeof(!num));
printf("%d\t",sizeof(var=15/2));
printf("%d",var);
return 0;
}
The program gave an output 4 4 5
. I didn't quite get why this happened.
- Why was the first output 4?
- Why didn't the value of
var
get updated to 7?
How does the sizeof
operator work?