C++ Creating a Menu and passing Args

  args, c++, parameters, void

So i want to basically call a void and store my menu, Menu Number, Text, and the function(void) im defiently doing this wrong however i can’t figure it out.

void AddMenu(char* text, int Menu, void* func)
{
        nMenu[Menu] = Menu;
        sMenu[Menu] = text;
        fMenu[Menu]* func;
}

So the idea would be

void AddMenu("Main Menu", 0, NULL);
void AddMenu("Option 1", 1, SomeVoid());
void AddMenu("Option 2", 2, NULL);
void AddMenu("Option 3", 3, NULL);
void AddMenu("Option 4", 4, NULL);

is there a better way of doing this?

int nMenu[32];
char* sMenu[32];
DWORD* fMenu[32];

int curMenu;
bool InMenu;




void AddMenu(char* text, int Menu, void* func)
{
        nMenu[Menu] = Menu;
        sMenu[Menu] = text;
        fMenu[Menu]* func;
}

Source: Windows Questions C++

LEAVE A COMMENT