what are the advantages & disadvantages of unions?
Answer Posted / vishnu nayak
Union occupy same memory area for different members in a
union.
Same are is allocated for different data types of the
members of union
eg:
union
{
int a;
char c;
float f;
}temp;
Size of Float will be size of union.
same memory is used for char and int as well.
Advantages: Memory consumption is less.
Disadvanteges: if one of the member variable is updated the
it will be reflected in the remaining 2 variables.
| Is This Answer Correct ? | 62 Yes | 18 No |
Post New Answer View All Answers
What is variable initialization and why is it important?
What's the right way to use errno?
Declare the structure which contains the following members and write in C list of all students who score more than 75 marks. Roll No, Name, Father Name, Age, City, Marks.
find out largest elemant of diagonalmatrix
What is operator promotion?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
WHICH TYPE OF JOBS WE GET BY WRITING GROUPS .WHEN THE EXAMS CONDUCTED IS THIS EXAMS ARE CONDUCTED EVERY YEAR OR NOT.PLS TELL ME THE ANSWER
What the different types of arrays in c?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
What is the use of getchar functions?
What are static variables in c?
What are extern variables in c?
How was c created?
What is the difference between constant pointer and constant variable?
What is structure in c definition?