Interview Questions

How do I initialize a pointer to a function?

C++ Interview Questions and Answers


(Continued from previous question...)

How do I initialize a pointer to a function?

 
This is the way to initialize
 a pointer to a function
void fun(int a)
{

}

void main()
{
void (*fp)(int);
fp=fun;
fp(1);

}

(Continued on next question...)

Other Interview Questions