I'm trying to find the number of elements in the menu1 array by using the current_menu variable but I'm not getting anywhere. I'm getting lost in a pointer inception kind of thing...
const char *menu1[] = { "Menu title", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 6", "Item 7", "Item 8", "Item 9" };
const char * *current_menu = menu1;
I tried:
sizeof(*current_menu) / sizeof(*current_menu[0])
sizeof(*(*current_menu)) / sizeof(*(*current_menu)[0])
But nothing's working... How can I do it?
Any help would be much appreciated!!