天天看點

'main' : function should return a value; 'void' return type assumed/////undeclared identifier

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

‘c’ : undeclared identifier

'main' : function should return a value; 'void' return type assumed/////undeclared identifier

在調試c程式時一直出現上述錯誤,下面是解決方法:

(1)‘main’ : function should return a value; ‘void’ return type assumed

'main' : function should return a value; 'void' return type assumed/////undeclared identifier

在main函數中最後加上return為0即可

(2)‘xxx’ : undeclared identifier

可能是xxx單詞拼寫錯誤,或者是未提前聲明,我的是粗心缺少了标點符号“,”,加上逗号就可以啦

'main' : function should return a value; 'void' return type assumed/////undeclared identifier
'main' : function should return a value; 'void' return type assumed/////undeclared identifier

繼續閱讀