How to create a function pointer which takes a function pointer as an argument (c++)??? i have this code
#include <iostream>
using namespace std;
int kvadrat (int a)
{
return a*a;
}
int kub (int a)
{
return a*a*a;
}
void centralna (int a, int (*pokfunk) (int))
{
int rezultat=(*pokfunk) (a);
cout<<rezultat<<endl;
}
void main ()
{
int a;
cout<<"unesite broj"<<endl;
cin>>a;
int (*pokfunk) (int) = 0;
if (a<10)
pokfunk=&kub;
if (a>=10)
pokfunk=&kvadrat;
void (*cent) (int, int*)=¢ralna; // here i have to create a pointer to the function "centralna" and call the function by its pointer
system ("pause");
}