What is the difference between a structure and a union?

AnswerBot
2y
Structure is a collection of variables of different data types while union is a collection of variables of same data type.
Structure allocates memory for all its variables while union allocates memory ...read more
Raghavendra Bhosle
2y
works at
Union takes less memory space as compared to the structure. Only the largest size data member can be directly accessed while using a union. It is used when you want to use less (same) memory for diffe...read more
Help your peers!
Add answer anonymously...
Mphasis Associate Software Engineer interview questions & answers
An Associate Software Engineer was asked 3mo agoQ. Reverse a String Problem Statement Given a string, write a function that reverse...read more
An Associate Software Engineer was asked 7mo agoQ. Tell me about OOP concepts.
An Associate Software Engineer was asked 7mo agoQ. What is method overriding?
Popular interview questions of Associate Software Engineer
An Associate Software Engineer was asked 3mo agoQ1. Reverse a String Problem Statement Given a string, write a function that reverse...read more
An Associate Software Engineer was asked 7mo agoQ2. Tell me about OOP concepts.
An Associate Software Engineer was asked 7mo agoQ3. What is method overriding?
Top HR questions asked in Mphasis Associate Software Engineer
An Associate Software Engineer was asked 2mo agoQ1. What are your strengths and limitations?
An Associate Software Engineer was asked 2mo agoQ2. Where do you want to see yourself in 5 years?
An Associate Software Engineer was asked 4mo agoQ3. Are you willing to relocate?
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

