Structure vs. Union
Structure and union both are user demarcated data types which contains variables of different data types. Both of them have same syntax for definition, declaration of variables and for retrieving members. Still there are many differences between structure and union. In structure every member get separate space in memory. In union, the total memory space allocated is equal to the member with biggest size. All other members share the same memory space. This is the biggest difference between structure and union.

Key Differences
Within a structure all members gets memory allocated and members have addresses that increase as the decelerators are read left-to-right. That is, the members of a structure all begin at different offsets from the base of the structure. For a union compiler allocates the memory for the largest of all members and in a union all members have offset zero from the base, the container is big enough to hold the WIDEST member, and the alignment is appropriate for all of the types in the union.

Aimie Carlson
Dec 18, 2015
All the members can be prepared while declaring the variable of structure. Only first member can be initialized while declaring the variable of union. In above example we can modify only variable roll no at the time of declaration of variable.
In structure we can admission any member in any sequence. Whereas in union we can access only that variable whose value is recently stored.
In structure every member get separate space in memory. In union, the total memory space allocated is equal to the member with biggest size. All other members share the same memory space. This is the biggest difference between structure and union.
One or more members of a structure can be initialized at once. A union may only be initialized with a value of the type of its first member; thus union u described above (during example declaration) can only be initialized with an integer value.
Within a structure all members gets memory assigned; therefore any member can be retrieved at any time. While retrieving data from a union the type that is being retrieved must be the type most recently stored.

Samantha Walker
Dec 18, 2015
ADVERTISEMENT
The amount of memory prerequisite to store a structure variable is the sum of the size of all the members. On the other hand, in case of unions, the amount of memory required is always equal to that required by its largest member.

Harlon Moss
Dec 18, 2015
With a union, you're only hypothetical to use one of the elements, because they're all stored at the same spot. This makes it useful when you want to store something that could be one of several types. A structure, on the other hand, has a separate memory location for each of its elements and they all can be used at once.

Aimie Carlson
Dec 18, 2015
Structure and Union Definitions
Structure
Something made up of a number of parts that are held or put together in a particular way
Hierarchical social structure.
Union
The act of uniting or the state of being united.
Structure
The way in which parts are arranged or put together to form a whole; makeup
Triangular in structure.
Union
A combination so formed, especially an alliance or confederation of people, parties, or political entities for mutual interest or benefit.
ADVERTISEMENT
Structure
The interrelation or arrangement of parts in a complex entity
Political structure.
Plot structure.
Union
(Mathematics) A set, every member of which is an element of one or another of two or more given sets.
Structure
Something constructed, such as a building.
Union
Agreement or harmony resulting from the uniting of individuals; concord.
Structure
The arrangement or formation of the tissues, organs, or other parts of an organism.
Union
The state of matrimony; marriage
"The element that was to make possible such a union was trust in each other's love" (Kate Chopin).
ADVERTISEMENT
Structure
An organ or other part of an organism.
Union
Sexual intercourse.
Structure
To give form or arrangement to
Structure a curriculum.
Structure one's day.
Union
A combination of parishes for joint administration of relief for the poor in Great Britain.
Structure
A cohesive whole built up of distinct parts.
The birds had built an amazing structure out of sticks and various discarded items.
Union
A workhouse maintained by such a union.
Structure
The underlying shape of a solid.
He studied the structure of her face.
Union
A labor union.
Structure
The overall form or organization of something.
The structure of a sentence.
The structure of the society was still a mystery.
Union
A coupling device for connecting parts, such as pipes or rods.
Structure
A set of rules defining behaviour.
For some, the structure of school life was oppressive.
Union
A device on a flag or ensign, occupying the upper inner corner or the entire field, that signifies the union of two or more sovereignties.
Structure
(computing) Several pieces of data treated as a unit.
This structure contains both date and timezone information.
Union
An organization at a college or university that provides facilities for recreation; a student union.
Structure
Underwater terrain or objects (such as a dead tree or a submerged car) that tend to attract fish
There's lots of structure to be fished along the west shore of the lake; the impoundment submerged a town there when it was built.
Union
A building housing such facilities.
Structure
A body, such as a political party, with a cohesive purpose or outlook.
The South African leader went off to consult with the structures.
Union
Union The United States of America regarded as a national unit, especially during the Civil War.
Structure
(logic) A set along with a collection of finitary functions and relations.
Union
Union Of, relating to, or loyal to the United States of America during the Civil War
A Union soldier.
Structure
(transitive) To give structure to; to arrange.
I'm trying to structure my time better so I'm not always late.
I've structured the deal to limit the amount of money we can lose.
Union
Of or relating to a labor union or labor union organizing
The union movement.
Union negotiations.
Structure
The act of building; the practice of erecting buildings; construction.
His son builds on, and never is contentTill the last farthing is in structure spent.
Union
(countable) The act of uniting or joining two or more things into one.
Structure
Manner of building; form; make; construction.
Want of insight into the structure and constitution of the terraqueous globe.
Union
(countable) The state of being united or joined; a state of unity or harmony.
Structure
Arrangement of parts, of organs, or of constituent particles, in a substance or body; as, the structure of a rock or a mineral; the structure of a sentence.
It [basalt] has often a prismatic structure.
Union
(countable) That which is united, or made one; something formed by a combination or coalition of parts or members; a confederation; a consolidated body; a league.
Structure
Manner of organization; the arrangement of the different tissues or parts of animal and vegetable organisms; as, organic structure, or the structure of animals and plants; cellular structure.
Union
(countable) A trade union; a workers' union.
Structure
That which is built; a building; esp., a building of some size or magnificence; an edifice.
There stands a structure of majestic frame.
Union
(countable) An association of students at a university for social and/or political purposes; also in some cases a debating body.
Structure
A thing constructed; a complex construction or entity;
The structure consisted of a series of arches
She wore her hair in an amazing construction of whirls and ribbons
Union
(countable) A joint or other connection uniting parts of machinery, such as pipes.
Structure
The manner of construction of something and the arrangement of its parts;
Artists must study the structure of the human body
The structure of the benzene molecule
Union
The set containing all of the elements of two or more sets.
Structure
The complex composition of knowledge as elements and their combinations;
His lectures have no structure
Union
(countable) The act or state of marriage.
Structure
A particular complex anatomical structure;
He has good bone structure
Union
Sexual intercourse.
Structure
The people in a society considered as a system organized by a characteristic pattern of relationships;
The social organization of England and America is very different
Sociologists have studied the changing structure of the family
Union
A data structure that can store any of various types of item, but only one at a time.
Structure
Give a structure to;
I need to structure my days
Union
A large, high-quality pearl.
Union
(historical) An affiliation of several parishes for joint support and management of their poor; also the jointly-owned workhouse.
Union
To combine sets using the union operation.
Union
Belonging to, represented by, or otherwise pertaining to a labour union.
Actors have to be union to get work here.
Union
The act of uniting or joining two or more things into one, or the state of being united or joined; junction; coalition; combination.
Union
Agreement and conjunction of mind, spirit, will, affections, or the like; harmony; concord.
Union
That which is united, or made one; something formed by a combination or coalition of parts or members; a confederation; a consolidated body; a league; as, the weavers have formed a union; trades unions have become very numerous; the United States of America are often called the Union.
Union
A textile fabric composed of two or more materials, as cotton, silk, wool, etc., woven together.
Union
A large, fine pearl.
If they [pearls] be white, great, round, smooth, and weighty . . . our dainties and delicates here at Rome . . . call them unions, as a man would say "singular," and by themselves alone.
In the cup an union shall he throw,Richer than that which four successive kingsIn Denmark's crown have worn.
Union
A device emblematic of union, used on a national flag or ensign, sometimes, as in the military standard of Great Britain, covering the whole field; sometimes, as in the flag of the United States, and the English naval and marine flag, occupying the upper inner corner, the rest of the flag being called the fly. Also, a flag having such a device; especially, the flag of Great Britain.
Union
A joint or other connection uniting parts of machinery, or the like, as the elastic pipe of a tender connecting it with the feed pipe of a locomotive engine; especially, a pipe fitting for connecting pipes, or pipes and fittings, in such a way as to facilitate disconnection.
Union
A cask suspended on trunnions, in which fermentation is carried on.
One kingdom, joy, and union without end.
[Man] is to . . . begetLike of his like, his image multiplied.In unity defective; which requiresCollateral love, and dearest amity.
Union
An organization of employees formed to bargain with the employer;
You have to join the union in order to get a job
Union
The United States (especially the northern states during the American Civil War);
He has visited every state in the Union
Lee hoped to detach Maryland from the Union
The North's superior resources turned the scale
Union
The act of pairing a male and female for reproductive purposes;
The casual couplings of adolescents
The mating of some species occurs only in the spring
Union
The state of being joined or united or linked;
There is strength in union
Union
The state of being a married couple voluntarily joined for life (or until divorce);
A long and happy marriage
God bless this union
Union
Healing process involving the growing together of the edges of a wound or the growing together of broken bones
Union
A political unit formed from previously independent people or organizations;
The Soviet Union
Union
A set containing all and only the members of two or more given sets;
Let C be the union of the sets A and B
Union
The occurrence of a uniting of separate parts;
Lightning produced an unusual union of the metals
Union
A device on a national flag emblematic of the union of two or more sovereignties (typically in the upper inner corner)
Union
The act of making or becoming a single unit;
The union of opposing factions
He looked forward to the unification of his family for the holidays
Union
Being of or having to do with the northern United States and those loyal to the Union during the Civil War;
Union soldiers
Federal forces
A Federal infantryman
Union
Of trade unions;
The union movement
Union negotiations
A union-shop clause in the contract
What is Structure?
Structure uses all the memory of its member. In structure we can admission any member in any sequence.
What is Union?
Union uses the largest member’s memory space. In union we can access only that variable whose value is recently stored.