Can you help me to start with them I cant find any information about them
the exactly thing i need its Array of pointers where the pointers are pointing a menu like this idea below.
Pls just help me with the syntax ...
Can you help me to start with them I cant find any information about them
the exactly thing i need its Array of pointers where the pointers are pointing a menu like this idea below.
Pls just help me with the syntax ...
Personally, what I might do is create a Menu struct. This struct would then have an array (or pointer to the first element of a dynamic array) of MenuCategory objects. Each MenuCategory object would then have an array (or pointer to the first element of a dynamic array) of MenuItem objects. It is each MenuItem object that will contain the string.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Ok but my boss gave this one for training and make me learn that triple pointers, so can you help me build that like the picture... I understand what I must do but my problem is the syntax ... can you help me with the syntax ...
Your boss wants you to be a Three Star Programmer?Originally Posted by westony
Follow my previous suggestion first. Post your attempt. When it is clear that you are capable of doing things in a more sensible way, I'll help you pretend to be a three star programmer.Originally Posted by westony
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Ok help me how make thathow to target those menu1,2,3 to those m1p1, m1p2 ... the other is easy game Just do not know how to declare that triple .............Code:*mainmenu[] = {"menu1", "menu2", "menu3"};
help its shows me:Code:***all; char *mainmenu[] = {"menu1", "menu2", "menu3", NULL}; all[0] = mainmenu;
for the last roll ...Warning 1 : 'char ***' differs in levels of indirection from 'char **'
Don't forget to allocate memory first.
It would be something like
Code:char *mainmenu[] = {"menu1", "menu2", "menu3"}; char *submenu[] = {"sub1", "sub2"}; char **all[] = { mainmenu, submenu };
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
You could, but that would allow an arbitrary number of menu levels, which may be contrary to what was described. (That said, a MenuItem abstraction may still be useful.)Originally Posted by MWAAAHAAA
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)