c語言報錯c4508,c語言報錯stray

本文目錄一覽:

編譯c程序時出現錯誤提示c4508是什麼問題

函數main在執行完畢之後需要一個返回值,而根據你的程序沒有或者可能會沒有返回值,所以程序給出一個警告~

或者可以將代碼貼出來 給你看看

c語言,我哪裡出錯了,錯誤一堆。

修改後:

#includestdio.h

// #includeiostream // 去掉,這個C++ 的。

void niba(int *tp,int *tp1) // 缺少返回值

{

int mad;

mad=*tp;

*tp=*tp1;

*tp1=mad;

}

void nima(int *p,int *p1,int *p2) // 缺少返回值

{

if(*p*p1) niba(p,p1); // 調用函數時,去掉*

if(*p*p2) niba(p,p2); // 調用函數時,去掉*

if(*p1*p2) niba(p1,p2); // 調用函數時,去掉*

}

int main()

{

int a,b,c,*p,*p1,*p2; // b.c.修改為b,c,

scanf(“%d,%d,%d”,a,b,c);

p=a,p1=b,p2=c;

nima(p,p1,p2);

printf(“\n%d,%d,%d\n”,a,b,c);

return 0;

}

剛學習C語言,遇到一段C語言,老是編譯錯誤,求解,謝謝

main函數有兩種書寫方式

1、void main()

2、int main(),這種方式在函數結尾需要加上return 1(1表示一個整型值,隨意);

c語言中C4508功能表示什麼?

你說的是編譯過後編譯器輸出的信息嗎,是Warning,或者是Error的序列號碼,也就是程序編譯後的警告或錯誤,你可以在MSDN中搜索C4508,可以查到其相關信息。

誰來幫我看下這段C語言代碼哪裡錯了

error C2065: ‘File’ : undeclared identifier;

error C2065: ‘fp’ : undeclared identifier;

warning C4552: ‘*’ : operator has no effect; expected operator with side-effect;

error C2440: ‘=’ : cannot convert from ‘struct _iobuf *’ to ‘int’;

warning C4244: ‘argument’ : conversion from ‘double’ to ‘int’, possible loss of data;

warning C4508: ‘main’ : function should return a value; ‘void’ return type assumed

這就是錯誤啊。。。百度一下都有,比如第一個是頭文件沒包含

原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/295133.html

(0)
打賞 微信掃一掃 微信掃一掃 支付寶掃一掃 支付寶掃一掃
小藍的頭像小藍
上一篇 2024-12-26 17:15
下一篇 2024-12-26 17:15

相關推薦

發表回復

登錄後才能評論