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

What is the difference between fread buffer() and fwrite buffer()?

0 Answers  


A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference

0 Answers  


How can variables be characterized?

0 Answers  


what is pointer?

13 Answers   HCL, TCS,


Write a program that takes a 5 digit number and calculates 2 power that number and prints it

5 Answers   ABS, Accenture, HCL, Infosys, Infotech, SoftSolve, Software India, TCS, Vertex, Vimukti Technologies,


What is the difference between int and float?

3 Answers  


a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none

0 Answers  


Define Spanning-Tree Protocol (STP)

0 Answers  


What is the difference between typedef and #define?

0 Answers  


What are variables c?

0 Answers  


What is cohesion and coupling in c?

0 Answers  


4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.

0 Answers   TCS,


Categories