C++ Programming Question:
Download Questions PDF

How do I initialize a pointer to a function?

C++ Programming Interview Question
C++ Programming Interview Question

Answer:

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

}

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

}

Download C++ Programming Interview Questions And Answers PDF

Previous QuestionNext Question
What does extern mean in a function declaration in C++?How do you link a C++ program to C functions?