#include <iostream>using namespace STD;typedef void(*PF) (int);voidFunintA) {cout<<"Here is the function fun (int) where the parameters are shaped"<< Endl;}voidPrintf (intA) {cout<<"Here is the function printf (int) where the parameter is shaped"<< Endl;}void(*pfun (int,void(*qfun) (int))) (int){//1. First this is a function, the function name is Pfun, there are two parameters, one is shaping, the other is a function pointer. //2. Second, the return value of this function is a pointer to the function, and the type is: void (*PF) (int). PF q = qfun; (*Q) (4);///This proves that the parameter is an integer and a function pointer. PF p = fun;returnP;}intMain () {PF q = Printf;The //function pointer points to the function.PF p = pfun (2, q); (*p) (3);///Here is the test return value, which proves that the return value is a function pointer. return 0;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
void (*pfun (int, void (*qfun) (int))) (int)