I have
enum Direction { NONE = 0, LEFT, RIGHT, FORWARD };
and there is a function
void displayDirection(int dir)
{ ... }
This function will take an int value and will print the members of "Direction" according to that value. How can it be possible? Thanks in advance.
ex: if dir = 0 print NONE; if dir = 1, print RIGHT; etc.
PS: I am very new at c++.