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
where are auto variables stored? What are the characteristics of an auto variable?
What is array in C
What is extern keyword in c?
Is it better to use a pointer to navigate an array of values, or is it better to use a subscripted array name?
What is define directive?
can any one provide me the notes of data structure for ignou cs-62 paper
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
int i=10; printf("%d %d %d", i, i=20, i);
How can I implement a delay, or time a users response, with sub-second resolution?
How main function is called in c?
Differentiate between full, complete & perfect binary trees.
Tell me about low level programming languages.
Explain can you assign a different address to an array tag?
When should structures be passed by values or by references?
Explain what is the best way to comment out a section of code that contains comments?