How do I initialize a pointer to a function?

Q

How do I initialize a pointer to a function?

✍: Guest

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

}

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

}

2012-03-12, 2515👍, 0💬