對於大學,我需要使用提供的模板創建一個基本桌面計算器。我已經成功地得到大部分完成,但有第9行(iScreenSetup();
此錯誤消息:警告]數據定義沒有類型或存儲類別[默認情況下啓用]
「【警告】數據定義沒有類型或存儲類[默認啓用]」
任何提示?
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"
#include "string.h"
/* Prototypes */
iScreenSetup();
iDataCapture();
iProcessData();
iReport();
iExit();
/* Declare and initialise global variables */
float fNum1 = 0.0;
float fNum2 = 0.0;
float fAns = 0.0;
int iOption = 0;
int main(void)
{
/* Set up the screen */
iScreenSetup();
/* Prompt the user and capture the data */
iDataCapture();
/* Process the data */
iProcessData();
/* Generate the report */
iReport();
/* Exit routine */
iExit();
} /* End of main */
您尚未在函數聲明中指定返回類型。默認情況下,它將採用'int'。例如。 ''iScreenSetup();'應該是' iScreenSetup();'例如'int iScreenSetup();'。 –
user1336087
2014-11-04 17:28:16
這與[隱式int](http://stackoverflow.com/q/26488502/1708801),在C89中如果你沒有指定類型是默認爲'int',雖然在C99之後這已不見了[許多編譯器仍然支持它](http://stackoverflow.com/q/26529235/1708801)。 – 2014-11-04 17:29:08
由於你的函數名從'i'開始,它應該返回'int'。例如。 'int iScreenSetup();' – user1336087 2014-11-04 17:37:16