|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
小甲鱼视频中的例子 用指针调用函数 编译出现下面的错误 不知道是不是代码也写错了 请大家帮忙看看
#include <stdio.h>
void main()
{
int max(int,int);
int min(int,int);
int add(int,int);
void process( int x,int y,int(*fun)() );
int a,b;
printf("Enter a and b: ");
scanf("%d %d",&a,&b);
printf("max = ");
process(a,b,max);
printf("min = ");
process(a,b,min);
printf("sum = ");
process(a,b,add);
}
int max(int x,int y)
{
int z;
if (x>y)
{
z = x;
}
else
{
z = y;
}
return z;
}
int min(int x,int y)
{
int z;
if (x<y)
{
z = x;
}
else
{
z = y;
}
return z;
}
int add(int x,int y)
{
int z;
z = x+y;
return z;
}
--------------------Configuration: test26 - Win32 Debug--------------------
Compiling...
test26.c
Linking...
test26.obj : error LNK2001: unresolved external symbol _process
Debug/test26.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
test26.exe - 2 error(s), 0 warning(s)
|
|