what are the advantages & disadvantages of unions?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / vadivelt
Main disadvantage is, all the union member variables cannot
be initialised or used with different values at a time.
| Is This Answer Correct ? | 45 Yes | 14 No |
write a c program to find the square of a 5 digit number and print the result.
5 Answers Accenture, Sasken, Vimukti Technologies,
What is define c?
Explain the concept and use of type void.
What are the back slash character constants or escape sequence charactersavailable in c?
What do mean by network ?
Study the Following Points: a.One Cannot Take the address of a Bit Field b.bit fields cannot be arrayed c.Bit-Fields are machine Dependant d.Bit-fields cannot be declared as static 1. Which of the Following Statements are true w.r.t Bit- Fields A)a,b&c B)Only a & b C)Only c D)All
Differentiate between Macro and ordinary definition.
What is selection sort in c?
What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
what are bitwise shift operators?
write a programe returns the number of times the character appears in the string
Define and explain about ! Operator?