Given the following code:
enum Enum {
  a = 0, b = 3, c
};
Which of these ways will allow you to iterate over items of the Enum type and execute a certain code fragment over each of them?
Explanation
enum is not intended to be iterated. The loop traversal will also have to handle items that are not part of the enumeration (for this example, values of 1 and 2).

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes