Passing a pointer to a function inside a class
Hi
Im having trouble passing a pointer to a function as another function's parameter:
Code:
void takesFuncPtr(bool (*func)()) {}
class egg
{
bool fry();
void passFry();
};
bool egg::fry() {}
void egg::passFry()
{
takesFuncPtr(fry);
}
this is basicaly what im trying to do, and i think i know what the problem is, i cant have the address of something that hasnt been created yet, and because of that the compiler gives me an error.
how can i get arround this problem??
tks in advance.