日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

c语言 error c4028,在Visual Studio2010中,“警告C4028:正式參數1與聲明不同”顯示。...

發(fā)布時間:2024/8/1 29 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言 error c4028,在Visual Studio2010中,“警告C4028:正式參數1與聲明不同”顯示。... 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Hi I have the below code

你好,我有下面的代碼。

I am getting the warning as "warning C4028: formal parameter 1 different from declaration"

我得到的警告是“警告C4028:正式參數(shù)1與聲明不同”

I am not sure where i went wrong. I think my declararion of parameter is correct but pls help me.

我不知道我哪里出錯了。我想我的參數(shù)說明是正確的,但請幫助我。

# 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已經(jīng)在數(shù)學中聲明為C庫函數(shù)。h有一個不同的原型。

You have to rename your sqrt function to something else.

你必須將你的sqrt函數(shù)重命名為別的東西。

總結(jié)

以上是生活随笔為你收集整理的c语言 error c4028,在Visual Studio2010中,“警告C4028:正式參數1與聲明不同”顯示。...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。