You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1011 B
1011 B
FUNC1和FUNC2定义为返回值为int的,参数为(int)的整型和 返回值为int,参数为(int*, int*, int*) 的类型;
——————————————————————————————————————————————
——————————————————————————————————————————————
#include <stdio.h>
int inc(int a)
{
return(++a);
}
int multi(int*a,int*b,int*c)
{
return(*c=*a**b);
}
typedef int(FUNC1)(int);
typedef int(FUNC2)(int*,int*,int*);
void show(FUNC2 fun,int arg1, int*arg2)
{
FUNC1 *p = &inc;
int temp =p(arg1);
fun(&temp,&arg1, arg2);
printf( "%d\n ",*arg2);
}
int main()
{
int a;
show(multi,10,&a);
}