标签:c++
#include <iostream> using namespace std; void mf() { static i=0; cout<<i++; } void (* set_function( void (*f)() ) )() { f(); (*f)(); return f;//分开看,就不晕了 } void set_function22( void (*f)() ) { f(); (*f)(); } int main(int argc, char const *argv[]) { typedef void (*fun)(); fun xiaoff=set_function(mf); xiaoff(); (*xiaoff)(); void (*fun22)()=set_function(xiaoff); fun22(); (*fun22)(); set_function22(fun22); return 0; }
标签:c++
原文地址:http://blog.csdn.net/h1023417614/article/details/46120993