How to make a menu with submenus?

Yes, but you don't need 2 similar structures that do nearly the same thing. When you have a leaf item (no children, i.e submenus) you set the subMenu pointer to null. Also remember to add a next pointer (and a prev one if you want do go in both directions), so you can navigate between menus on the same level. Also,

on itself will not work, unless you do a typedef first.

This, however:

is OK.

As I said in post #9, start very simple, test, and add complexity when you have a working skeleton: that's how I'd work, anyway. Try to start with a flat menu and just display a dummy string for every menu item. See if you can navigate back and forth.

1 Like