c语言 error c4028,在Visual Studio2010中,“警告C4028:正式參數1與聲明不同”顯示。...
Hi I have the below code
你好,我有下面的代碼。
I am getting the warning as "warning C4028: formal parameter 1 different from declaration"
我得到的警告是“警告C4028:正式參數1與聲明不同”
I am not sure where i went wrong. I think my declararion of parameter is correct but pls help me.
我不知道我哪里出錯了。我想我的參數說明是正確的,但請幫助我。
# include
# include
# include
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);
}
1 個解決方案
#1
5
int x,y(),z,sqrt(int),cube(int);
sqrt is already a C library function declared in math.h with a different prototype.
sqrt已經在數學中聲明為C庫函數。h有一個不同的原型。
You have to rename your sqrt function to something else.
你必須將你的sqrt函數重命名為別的東西。
總結
以上是生活随笔為你收集整理的c语言 error c4028,在Visual Studio2010中,“警告C4028:正式參數1與聲明不同”顯示。...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 凌度行车记录仪刷机包_凌度行车记录仪怎样
- 下一篇: 单片机中断程序