|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 学习c学习u 于 2017-5-2 18:54 编辑
能帮我看看错在哪吗?
--------------------Configuration: 1 - Win32 Debug--------------------
Linking...
1.obj : error LNK2001: unresolved external symbol _process
Debug/1.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
1.exe - 2 error(s), 0 warning(s)
下面是代码
#include<stdio.h>
void main()
{
int max(int, int);
int min(int, int);
int sum(int, int);
int a,b;
int process(int, int, int(*)());
int (*c)() = max;
printf("Input a and b:");
scanf("%d,%d", &a, &b);
printf("%d,%d\n", a, b);
printf("The max is %d\n", process(a, b, c));
printf("The min is %d\n", process(a, b, min));
printf("The sum is %d\n", process(a, b, sum));
}
int max(int a, int b)
{
if(a > b)
{
return a;
}
else
{
return b;
}
}
int min(int a, int b)
{
if(a > b)
{
return b;
}
else
{
return a;
}
}
int sum(int a, int b)
{
return (a+b);
}
int progress(int a, int b, int(*f)())
{
return (f(a,b));
} |
|