C
chandanlinster
consider the following program:
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
int i;
double f;
printf("size = %u", sizeof((0)?f:i)); /* 0 is zero */
putchar('\n');
exit(0);
}
output:
size = 8
since 'i' is supposed to be an "int", on my 32-bit system I expected
the size to be 4 bytes. Why does this happen?
#include <stdio.h>
#include <stdlib.h>
int
main(void)
{
int i;
double f;
printf("size = %u", sizeof((0)?f:i)); /* 0 is zero */
putchar('\n');
exit(0);
}
output:
size = 8
since 'i' is supposed to be an "int", on my 32-bit system I expected
the size to be 4 bytes. Why does this happen?