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...


difference between structure and union.

Answers were Sorted based on User's Feedback



difference between structure and union...

Answer / truong nguyen

Regarding the struct, each item in the struct is allocated
in a separated memory. And the size of a struct object is
total size of all its items.
But with the union, all its items are in the same memory.
And the size of an union object is size of its item which
has largest size.

Is This Answer Correct ?    24 Yes 0 No

difference between structure and union...

Answer / siva sankari

struct employee
{
int a[20];// for tis size 20 was allocated in memory
char text;// for tis only 1byte of memory space is allocated
}
so totally 21 in size was allocated in memory space

union employee
{
int a[20];// for tis size 20 was allocated in memory
char text;// for tis only 1byte of memory space is allocated
}
but in union it takes only the maximum memory space so for each 20space totally 40 size was allocated in memory space

Is This Answer Correct ?    7 Yes 12 No

Post New Answer

More OOPS Interview Questions

how to find no of instances of an object in .NET?

1 Answers   Infosys,


What is object in oop with example?

0 Answers  


Explain the concept of abstracion and encapsulation with one example. What is the difference between them?

3 Answers   PCS,


program for insertion ,deletion,sorting in double link list

0 Answers  


When is it necessary to use member-wise initialization list in C++?

2 Answers   Adobe,


what is a ststic variable and stiticfunction briefly explain with exmple and in which case we use

2 Answers   HCL,


what are the ways in which a constructors can be called?

2 Answers   TCS,


What are functions in oop?

0 Answers  


who is the father of OPPS

4 Answers   Infosys, TCS,


Does c++ support multilevel and multiple inheritance?

9 Answers   IBS, Wipro,


how to get the oracle certification? send me the answer

0 Answers   Oracle,


I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?

3 Answers  


Categories