Parameters in function pointers
Trying to get around the old "invalid use of void expression" is starting to annoy me now. How do I pass parameters into a function that is a parameter of another function? Such as here:
Code:
MainMenu->CreateMenuItem("Play",SDL_Color{0,255,0},SDL_Color{255,255,255},New(this));
MainMenu->CreateMenuItem("High Scores",SDL_Color{255,0,0},SDL_Color{255,255,255},NULL);
MainMenu->CreateMenuItem("Exit",SDL_Color{255,0,0},SDL_Color{255,255,255},(*exit)(0));
while(MainMenu->Run(Display));
exit(0);
}
}
}
void New(void* data)
{
cGame* temp = static_cast<cGame*>(data);
temp->Phase = G_NEW_GAME;
}
Attempting to pass any data to the function just results in that error. I looked it up and can't find anything that helps. Code is cutoff also. Ignore the brackets.