im working on converting C code to c++ , in one section of the code i have something like function array in C that looks like:
this is how C looks like :
void func1(bool a)
{
..
}
void func2(bool a)
{
..
}
void func3(bool a)
{
..
}
struct func
{
void (*f)(incoming *);
int arg_length;
};
typedef struct func func;
func funcs[] = {
{ func1, 4 },
{ func2, 10 },
{ func3, 4 }
};
how can it converted to c++?
UPDATE:
question: is this is valid answer for none static function pointers ?
http://www.newty.de/fpt/fpt.html#chapter2
also can i define Array of different types of member function pointer?