SN.
|
Structure
|
Union
|
1
|
Struct keyword is used to make structure variable
|
Union keyword is
used to make structure variable
|
2
|
Structure is user defined data type which is used frequently to
represent real word data type presentation.
|
Union is also a user defined data type which is used to achieve specific
need.
|
3
|
Structure allocates memory for its all member.
|
Union allocates memory only for the biggest data member.
|
4
|
All member data can be hold at same time in a structure variable.
|
Only one data from member can be hold at a time.
|
5
|
Several members can be initialized at ones.
|
Only first member can be initialized.
|
Wednesday, 15 July 2020
Difference between Union & Structure
A programmer and Founder of Girfa
IT Services, working from 2009.At Starting computer teaching was my full-time job but after 10 years of teaching I chose to programming as a full-time job and teaching become part-time. In real life, I am very lazy and I made it my coding style I always try to make a reusable component that’s my USP for programming which saves my time and extra working both.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment