Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what are the advantages & disadvantages of unions?

Answers were Sorted based on User's Feedback



what are the advantages & disadvantages of unions?..

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

what are the advantages & disadvantages of unions?..

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

Post New Answer

More C Interview Questions

Is reference used in C?

1 Answers  


Explain the concept of "dangling pointers" in C.

2 Answers  


biggest of two no's with out using if condition statement

8 Answers  


What should malloc(0) do?

0 Answers  


What is main () in c?

0 Answers  


how to TOGGLE Nth bit of variable in a MACRO

1 Answers   NDS,


list the no of files created when c source file is compiled

9 Answers   TCS,


nic scientist exam

1 Answers   NIC,


What is #define?

0 Answers  


control 50 devices which has 2 states on and off.using bitwise operator.plz answer it its urgent

1 Answers  


Explain what are the standard predefined macros?

0 Answers  


what is the role you expect in software industry?

0 Answers   HCL,


Categories