MCQs
we are getting the values from march to november and printing its concern number.
The enumerator values start from zero if it is unassigned.
Output:
$ g++ enum3.cpp
$ a.out
012345
enumartion variable 'star' appears two times in main() which causes the error. An enumaration
constant must be unique within the scope.
If we not assigned any value to enum variable means, then the next number to initialized number will
be allocated to the variable.
Output:
$ g++ enum2.cpp
$ a.out
323334
The age will be divided by using compound assignment operator and so it will return the age of the
cat according to your age.
$ g++ enum1.cpp
$ a.out
If you were cat, you would be 2
The enum variable are converted to integer and stored by compiler. So both are equal in size.
Enumerator will allocate the memory when its variables are defined.
Since enumerators evaluate to integers, and integers can be assigned to enumerators, enumerators
can be assigned to other enumerators.
None.
enumerators are used in order to create our own types whereas macros are textual substitutions.