I have an enumeration for example.
enum {
APPLE,
MANGO,
BANANA
}
and the corresponding array of strings
char fruits[] =
{
"apple",
"mango",
"banana"
}
I need to get the row index if I have a row. Therefore, given that the string is an apple, I need to get 0 and so on. [ Enummay also help the solution]
Is there an elegant way to keep [apple,0],[banana,1]that short and simple that I can use as a macro. I don't need long things like a hash table. Can it Enumhelp in displaying?
source
share