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?
Discussion:
49 comments Page 1 of 5.
Keerthana said:
6 years ago
All are user-defined datatypes which allow the user to create their own datatype which can be a combination of int, float, char, etc.
(6)
Bhushan shriram said:
7 years ago
Please, explain about union?
(2)
Rekha said:
7 years ago
Which is better to use structure or union? Any one explain in detail.
(2)
Vishu said:
8 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.
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.
Neelima said:
9 years ago
Do the outputs for structure & union is same?
Sonali Adhav said:
9 years ago
Array.
Pointer.
Structure.
Union.
Enum.
Are the user defined or secondary types of data type in C?
Pointer.
Structure.
Union.
Enum.
Are the user defined or secondary types of data type in C?
(2)
Pallavi said:
9 years 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.
Sarath said:
9 years 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.
Lokija said:
9 years ago
I can't understand explain clearly.
Jiten said:
9 years ago
Structure are user define data types in which you can store more than one data type variable. It is similar to union. But in union you can access only one value at a time because in union memory allocated to only one member at a time. While in structure all of its member have its own memory. That's why structure is taking more memory then union.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers