C Programming - Structures, Unions, Enums - Discussion

Discussion Forum : Structures, Unions, Enums - General Questions (Q.No. 2)
2.
What is the similarity between a structure, union and enumeration?
All of them let you define new values
All of them let you define new data types
All of them let you define new pointers
All of them let you define new structures
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
50 comments Page 3 of 5.

Sarath said:   1 decade ago
Because the secondary data types are arrays, pointers, structures, union and enum, they are user defined data types All of them let you define new data types.

Pallavi said:   1 decade ago
Structure mean collection of multiple element that can be of different data types. Definition of union is same of structure but only data element is stored in union variable.

Lipsa said:   2 decades ago
I agree with the runa and the main difference is the structure allocate different memory location with the data types but union allocate one large memory location for their members.

Neelima said:   1 decade ago
Do the outputs for structure & union is same?

Vishu said:   9 years ago
@Kamal.

Linked list: list is a collection of elements. There are 2 ways of maintaining list in computer memory. The first way is to take an array for sorting elements of the list. But arrays have some disadvantage. Insertion and deletion of the element require more processing. The second way is implementing a list in a memory by using a self-referential structure.

Varun said:   2 decades ago
But what is the difference?

Yamuna said:   2 decades ago
Since Structure,Union,Enum are all User defined data types so user can use new values...thus logic is simple.. :-)

Lokeswari said:   2 decades ago
What is pointer?

Pradeep bhupathi said:   2 decades ago
Array, pointer, structure, union, enum - These all are user defind data types in c language.

Senthil.J said:   1 decade ago
I agree with raju he have given a good explanation about these.

In short structures are used to share different memory locations for variable and union is used to allocate large memory for all variables.


Post your comments here:

Your comments will be displayed after verification.