C - Structures,Unions - Discussion

You Are Here :: Home > C > Structures,Unions - Discussion

 



Q.

What is the output of this C code?

#include
union utemp
{
int a;
double b;
char c;
}u;
int main()
{
u.c = 'A';
u.a = 1;
printf("%d", sizeof(u));
}
The output will be: (Assuming size of char = 1, int = 4, double = 8)

A. 1 B. 4
C. 8 D. 13

Answer: Option C
Explaination:

No Explanation



Discussion

Your Comments Goes here...
NameDiscussion