explain about storage of union elements.
Answer Posted / 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 View All Answers
What is the code in while loop that returns the output of given code?
what is the syallabus of computer science students in group- 1?
Why doesnt that code work?
What is variable initialization and why is it important?
Explain how can I read and write comma-delimited text?
What is the difference between the expression “++a” and “a++”?
Why is c called c?
What is the difference between int main and void main?
Write a program of prime number using recursion.
What is void pointers in c?
Define circular linked list.
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
How do you use a 'Local Block'?
What is printf () in c?
hi any body pls give me company name interview conduct "c" language only