explain about storage of union elements.

Answers were Sorted based on User's Feedback



explain about storage of union elements...

Answer / saranya

union elements share common memory space

Is This Answer Correct ?    18 Yes 0 No

explain about storage of union elements...

Answer / anandi

Union elements can share the common memory spaces.

For eg.

union stu
{
int rno;
int mark;
float total;
};

In this pg, the compiler allocates 4 bytes to store the
union members. Bcoz, in this pg, the float data type only
requires the large memory size, ie, 4 bytes. And the
remaining members can share this 4 bytes. So if u want to
store rno, it will allocate the first 2 bytes.
And also we can store only one value at a time to the
memory.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More C Interview Questions

write a programme that inputs a number by user and gives its multiplication table.

2 Answers  


Predict the output or error(s) for the following: 25. main() { printf("%p",main); }

3 Answers   Google, ME,


What is dangling pointer in c?

0 Answers  


Is anything faster than c?

0 Answers  


no consistent academics. how to answer the question

0 Answers  






What is the right type to use for boolean values in c? Is there a standard type?

0 Answers  


int i =10 main() { int i =20,n; for(n=0;n<=i;) { int i=10 i++; } printf("%d", i);

6 Answers   HCL, Octal, SW,


Differentiate between the expression “++a” and “a++”?

0 Answers  


what is const volatile?

2 Answers  


What is the meaning of this decleration? unsigned char (*pArray[10][10]); please reply.

1 Answers  


Can a local variable be volatile in c?

0 Answers  


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

0 Answers   HCL,


Categories