difference between structure and union.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is class and object with example?

585


What is the use of oops?

621


What is a class oop?

594


What is static modifier?

632


I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...

1628






design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6151


What is the advantage of oop over procedural language?

628


What is stream in oop?

841


What is polymorphism used for?

572


What are the three main types of variables?

600


Following are the class specifications: class {int a}; class {int b}; Using friend funtion,calculate the max of two objects and display it.

2008


What are the two different types of polymorphism?

672


Can static class have constructor?

585


Why do we use class?

635


what are the realtime excercises in C++?

2335