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 the value of h?
How to set file pointer to beginning c?
Why do we use c for the speed of light?
can any one please explain, how can i access hard disk(physical address)? it is possible by the use of far,near or huge pointer? if yes then please explain......
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
What is formal argument?
Where are some collections of useful code fragments and examples?
Describe how arrays can be passed to a user defined function
What is the purpose of clrscr () printf () and getch ()?
hai iam working in sap sd module for one year and working in lumax ind ltd in desp department but my problem is i have done m.b.a in hr/marketing and working sap sd there is any combination it. can you give right solution of my problem. and what can i do?
What are different types of variables in c?
What is variable declaration and definition in c?
Explain 'bit masking'?
What is structure in c definition?
Write a program to show the change in position of a cursor using c