How can I access each value of the enum by the index?
for instance,
enum food{PIZZA, BURGER, HOTDOG};
as we all know, the index of the first element starts from 0 unless initialized.
How can I get the string value of the enum from the index?
How can I get it to print the PIZZA?
cout << food(0);
I know it's not correct, but please advise me thanks.