Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 19
Why enumerated datatype is preferred over structures?
5 Réponses
+ 16
Okay thanks! 😊
+ 15
Thanks!🙂
+ 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/
+ 6
I know ,but why we prefer enumerated datatype is my question
0
Beta dono alg cheeze hai