Why enumerated datatype is preferred over structures? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 19

Why enumerated datatype is preferred over structures?

13th Jun 2020, 10:54 AM
Mayuri
Mayuri - avatar
5 Answers
+ 16
Okay thanks! 😊
13th Jun 2020, 5:42 PM
Mayuri
Mayuri - avatar
+ 15
Thanks!🙂
13th Jun 2020, 12:18 PM
Mayuri
Mayuri - avatar
+ 9
Both are user-defined data types. Enumerations make code simpler to read or maintain. They are generally used when values are of integer type like for number of months: enum month {January, February, March,..., December}; The next can be number of days in a month enum days {28, 29, 30, 31}; Much of the functions vary with POP and OOP languages for structures. For C you can use these links to get a better idea of them: Enumerations in C: https://www.geeksforgeeks.org/enumeration-enum-c/ Structures in C: https://www.geeksforgeeks.org/structures-c/
13th Jun 2020, 12:13 PM
Prabhanshu Chaturvedi
+ 6
I know ,but why we prefer enumerated datatype is my question
1st Jul 2020, 7:39 AM
Mayuri
Mayuri - avatar
0
Beta dono alg cheeze hai
1st Jul 2020, 7:36 AM
i.am.Abhinav Saxena
i.am.Abhinav Saxena - avatar