关于函数指针数组的使用

直接看代码,仿计算satd的函数typedef int  (*x264_pixel_cmp_t) ( uint8_t *, int, uint8_t *, int );
typedef int (*x264_test)(int,int);
 
int addab(int a,int b);
int c=0;
 
x264_test x_t[20];
x_t[10]=addab;
 
c=x_t[10](1000,200);//注意这里的x_t[10]已经是相当于*(x_t+10),故不用再加*
printf("%d",c);
 
return 0;
}
 
int addab(int a,int b)
{
return(a+b);
}
posted @ 2013-02-24 13:22  yurius  阅读(118)  评论(0编辑  收藏  举报