What are enumerated data types in C? - ProProfs Discuss
Advertisement

What are enumerated data types in C?

What are enumerated data types in C?

Change Image    Delete

Asked by G. Horace, Last updated: Mar 26, 2024

+ Answer
Request
Question menu
Vote up Vote down

1 Answer

A. Daniels

A. Daniels

A. Daniels
A. Daniels, Professor, San Diego

Answered Aug 06, 2018

Enumerated data types (enum) in C mean the user has defined the data type in order to make the program easy to read and maintain. Said another way, enum is used to “assign names to integral constants”. Four interesting points to know about enum: (1) if values are not explicitly assigned via enum names, by default the compiler will assign values starting from 0, (2) values can be assigned in any order; all unassigned names get values with the value of the previous name plus one. (3) enum names must be some integral constant in a range from minimum to maximum, and (4) all enum constants must be unique.

upvote downvote
Reply 

Advertisement
Advertisement
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader
Image Preview
Search for Google images Google Image Icon
Select a recommended image
Upload from your computer Loader

Email Sent
We have sent an email to your address "" with instructions to reset your password.