Enumerations--enum

Hi all,

1-I just want to know whether members of an enum can be assigned only int values.
2-Can I make a function's parameter type be an it instead of an enum type and pass a variable of that enum?

Please help,
Aceix.
1. Members of an enumeration can be assigned constant integral expressions. They are not necessary of type int.

2. Yes you can do that if an enumeration has no fixed underlying type and all its enumerators are representable in the int type or if an enumeration has fixed underlying type int.
Last edited on
Topic archived. No new replies allowed.