I have task that should take above enum as input argument and i need get index or value assigned for each fruit in enum declaration like 0 ,1 or 2 to be assigned to local variable fruit_val. My code looks like below:
Did you read Section 6.19.4 Enumerated types in numerical expressions in the LRM? Did your code compile? Did you get a syntax error? Did your code run? Did your code give you a run-time error? Did your code work as expected? Did you get a different result than you expected?
It is difficult to provide assistance without additional information regarding the issue you are having.