I have seen following examples in test your c(Author : Yashvant Kanetkar).
In following example, sizeof()
gives the output 8
.
#include<stdio.h>
double d;
int main()
{
(int)(float)(char)d;
printf("%d\n",sizeof(d));
}
But in second example, sizeof()
gives the output 4
.
#include<stdio.h>
double d;
int main()
{
printf("%d\n",sizeof((int)(float)(char)d));
}
Why both output different? There is no explanation in book.