devxlogo

Enumeration Types

Enumeration Types

Question:
Can you make an array of enumeration types?If so, how do you do it?

Answer:
Yes you can, and it is very simple:

enum direction {  Up,  Down};direction arr[10]; // create arrayarr[0] = Down; // use array

devx-admin

Share the Post: