Examveda

What is the difference between a structure and a union in C++?

A. Structures cannot contain member functions

B. Unions are used for mathematical operations

C. In a structure, each member has its own memory space, while in a union, all members share the same memory space

D. Structures are used for data organization

Answer: Option C


Join The Discussion

Related Questions on Structures and Unions in C plus plus

What is a structure in C++?

A. A collection of functions

B. A reserved keyword in C++

C. A user-defined data type containing variables of different data types

D. A way to declare arrays of data