What? You already seem to know how to create a function pointer (line 24) the only difference would be the return value and the parameters. void(*Vptr)() = nullptr;
But if what you're after is to pass the function pointer into the central() function then you would use something like the following in place of your "void" question. central(num, ptr);
I know that but how to make a pointer to a function that as an argument have a pointer to a function? How to make a pointer to void "centar(int broj, int(*p)(int))"?
I know that but how to make a pointer to a function that as an argument have a pointer to a function
Declares a pointer-to-function named foo returning void accepting a pointer-to-function returning void and taking no parameters: void (*foo)(void(*)()) = nullptr;
Declares a pointer to function named pcentral returning void accepting an int and a pointer to function returning int and accepting an int: void (*pcentral)(int, int(*)(int)) = central;
It is usually a good idea to introduce an alias; the function pointer syntax is obscure enough as is:
Aliases a pointer-to-function returning int and accepting an int: typedefint(*pfn)(int);
Declare central using that alias: void central(int a, pfn b);
Declare a pointer to central: void (*pcentral)(int, pfn b) = central;
P.S.:
Maybe you're using C, but if not, now is a good time to look into alternatives to function-pointers. You are likely to gain genericity and readability at the same time.
P.P.S.:
Sometimes http://cdecl.org/ is a useful aid (but it's not as good as a compiler).