explain about storage of union elements.
Answers were Sorted based on User's Feedback
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 |
What are the parts of c program?
What is far pointer in c?
What are volatile variables in c?
What is a loop?
What is wrong with this statement? Myname = 'robin';
What is meant by operator precedence?
What is pragma in c?
How does free() know explain how much memory to release?
How can I open files mentioned on the command line, and parse option flags?
how can make variable not in registers
What is the data segment that is followed by c?
who developed c and why he developed c?