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 are local static variables? How can you use them?
What should malloc() do?
What is use of #include in c?
What is the value of h?
Do you know the use of fflush() function?
What is malloc() function?
Explain modulus operator.
Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.
How will you divide two numbers in a MACRO?
WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..
What is structure padding and packing in c?
What is sizeof int in c?
Is there a way to switch on strings?
How do you convert strings to numbers in C?
What functions are used for dynamic memory allocation in c language?