what is the output of this C code
output:
66 B
4
Explanation:
union temp t={66,'A'};
this statement will initialize only the first member of the union x with 66 and the compiler will ignore the second value 'A', as one element is sufficient to initialize all union members as they share the same memory locations
sizeof(t) =4 size of largest element in memory location
output:
66 B
4
Explanation:
union temp t={66,'A'};
this statement will initialize only the first member of the union x with 66 and the compiler will ignore the second value 'A', as one element is sufficient to initialize all union members as they share the same memory locations
sizeof(t) =4 size of largest element in memory location
No comments:
Post a Comment