Call back function easily implement
#include <stdio.h> void HelloWorld(int nIndex) { printf("%d person say Hello World\n",nIndex); } void MyName(int len) { printf("My name is 萧%d郎", len); } void callback(int i, void (* print)(int)) { print(i); } void main(void) { callback(10,HelloWorld); callback(11, MyName); getchar(); }
Call back function implement,布布扣,bubuko.com
原文地址:http://blog.csdn.net/denyz/article/details/25721331