Review: Function Pointer
Two ways to make use of it:
1) directly declare a function pointer variable at the place where it's required. like below:
void (*pFunc)(int); // pFunc is a variable here
pFunc = &FuncA;
pFunc(2);
2) typedef a function poiner type and then use it. like below:
typedef void (*pFunc)(int);
pFunc pFuncObj = &FuncA;
pFuncObj(2);
1) directly declare a function pointer variable at the place where it's required. like below:
void (*pFunc)(int); // pFunc is a variable here
pFunc = &FuncA;
pFunc(2);
2) typedef a function poiner type and then use it. like below:
typedef void (*pFunc)(int);
pFunc pFuncObj = &FuncA;
pFuncObj(2);