79113255

Date: 2024-10-22 09:14:20
Score: 1
Natty:
Report link

What you are looking for is an array, not an enumerator. Enumerators are used for accessing a number representation of a constant value. You can't access it directly backwards.

https://www.w3schools.com/c/c_enums.php https://www.codecademy.com/resources/docs/c/enums

You should use instead a Char array like this:

const char *fruitNames[] = {
    "Apple",
    "Banana",
    "Peach"
};

printf("%s", fruitNames[1]);
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What you are
  • Low reputation (1):
Posted by: NVL.