C++ Programming Question: Download Questions PDF
How do I initialize a pointer to a function?
![C++ Programming Interview Answer C++ Programming Interview Question](https://globalguideline.com/public/images/interview/24.png)
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);
}
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 Question | Next Question |
What does extern mean in a function declaration in C++? | How do you link a C++ program to C functions? |