Type some parentheses after the function pointer name, and put the arguments between the parentheses:
Code:
#include <iostream>
using namespace std;
void display(int n, double d)
{
cout<<n<<endl;
cout<<d<<endl;
}
int main()
{
void (*myfunc)(int, double);
myfunc = display;
myfunc(10, 30.5);
return 0;
}
Or, with a typedef:
Code:
#include <iostream>
using namespace std;
typedef void (*TESTFUNCTION)(int, double);
void display(int n, double d)
{
cout<<n<<endl;
cout<<d<<endl;
}
int main()
{
TESTFUNCTION a = display;
a(100, 200.5);
return 0;
}