C++ Programming Question: Download C++ Programming PDF
How do I initialize a pointer to a function?
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);
}
Previous Question | Next Question |
What does extern mean in a function declaration in C++? | How do you link a C++ program to C functions? |