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.
Runa said:
1 decade ago
Structures unions and enumeration is used to create a new datatyppe that holds all kinds of datatype that is it includesn a datatype that can hold int, float, char, array inside a user ndefined datatype.
Pradeep bhupathi said:
1 decade ago
Array, pointer, structure, union, enum - These all are user defind data types in c language.
Lokeswari said:
1 decade ago
What is pointer?
Yamuna said:
1 decade ago
Since Structure,Union,Enum are all User defined data types so user can use new values...thus logic is simple.. :-)
Varun said:
1 decade ago
But what is the difference?
Lipsa said:
1 decade 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.
Surya said:
1 decade ago
These are used to create a new data type that holds all data types.
Nagarjun said:
1 decade ago
S.I agree vtt the Lips .but Enumrated gives the different states of a variable
example;
Enum person
{
male,fmale;
}
where the person having 2 states male r female;
example;
Enum person
{
male,fmale;
}
where the person having 2 states male r female;
Devi said:
1 decade ago
Thanks for your explanation.
Ashish Moreshwar said:
1 decade ago
Question is the similarity between a structure, union and enumeration. I think These all are the user defined data type. That holds various types of other data types.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers