Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Enumeration syntax

Can someone please explain to me which part is what in this:

enum bb { cc } dd;

I understand that enum bb is the name of the enumeration and that { cc } is its enumerator, but I have no clue what dd is.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

enum bb
{
  cc
} dd;
  1. bb – enum tag.
  2. cc – enumerator constant. As it is first and it does not have an expicity defined value it will be zero (0);
  3. dd – variable of type enum bb

It can be written as:

enum bb
{
  cc
};

enum bb dd;
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading