可以用二级指针表示 存储函数指针的数组的地址吗?
#include<stdio.h>intsum(intx,inty);intproduct(intx,inty);//乘积。intdifference(intx,inty...
#include<stdio.h>
int sum(int x, int y);
int product(int x, int y); //乘积。
int difference(int x, int y);
int main(void)
{
int a = 10;
int b = 5;
int result = 0;
int (*pfun[10])(int, int);
pfun[0] = sum;
pfun[1] = product;
pfun[2] = difference;
int (**s);
s= pfun;
printf("the address of array pfun is %d", pfun);
}//end main
报错:1>c:\users\weilong\documents\visual studio 2010\projects\11\11\7_arrays of ptrs to funcs.c(22): warning C4047: “=”:“int”与“int (__cdecl **)(int,int)”的间接级别不同 展开
int sum(int x, int y);
int product(int x, int y); //乘积。
int difference(int x, int y);
int main(void)
{
int a = 10;
int b = 5;
int result = 0;
int (*pfun[10])(int, int);
pfun[0] = sum;
pfun[1] = product;
pfun[2] = difference;
int (**s);
s= pfun;
printf("the address of array pfun is %d", pfun);
}//end main
报错:1>c:\users\weilong\documents\visual studio 2010\projects\11\11\7_arrays of ptrs to funcs.c(22): warning C4047: “=”:“int”与“int (__cdecl **)(int,int)”的间接级别不同 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询