C 函数指针数组
#include <stdio.h>
int add(int a , int b)
{
return a + b;
}
int mul(int a, int b)
{
return a * b;
}
int main()
{
int (*op[2])(int a, int b);
op[0] = add;
op[1] = mul;
printf("%d/n", (*op[0])(1 , 2));
printf("%d", (*op[1])(1, 2));
getchar();
}
2009-07-07 15:40:36