use*_*039 1 c visual-studio-2010
嗨,我有以下代码
我收到警告"警告C4028:正式参数1与声明不同"
我不知道我哪里出错了.我认为我的参数声明是正确的,但请帮助我.
# include <stdio.h>
# include <conio.h>
# include <math.h>
main()
{
int x,y(),z,sqrt(int),cube(int);
printf("Enter any number:");
scanf("%d",&x);
z=(x>y() ? sqrt(x):cube(x));
printf("%d",z);
getche();
return 0;
}
int sqrt(int a)
{
printf("Square:");
return(a*a);
}
int cube(int b)
{
printf("Cube:");
return(b*b*b);
}
int y()
{
return(10);
}
Run Code Online (Sandbox Code Playgroud)
int x,y(),z,sqrt(int),cube(int);
Run Code Online (Sandbox Code Playgroud)
sqrt已经是一个math.h用不同原型声明的C库函数.
您必须将您的sqrt功能重命名为其他内容.
| 归档时间: |
|
| 查看次数: |
1571 次 |
| 最近记录: |