最小化的回调函数示例


1
#include "stdio.h" 2 3 int Yao(float a, float b) 4 { 5 printf("Yao\n"); 6 return a + b; 7 } 8 9 void myCallback(int (*perfect)(float ,float )) 10 { 11 printf("%d\n", perfect(6,7)); 12 } 13 14 void main() 15 { 16 myCallback(Yao); 17 }
posted @ 2012-12-01 11:09  Roarsun  阅读(133)  评论(0编辑  收藏  举报