-1
我寫一個非常簡單的程序,一類顯示模擬的天氣數據,我不能弄清楚爲什麼Visual Studio中不斷給我一個錯誤易C程序錯誤
誤差溫度通過方向的告訴我:錯誤C2440: '=':不能從轉換 '雙(__cdecl *)(無效)' 到 '雙'
IM迷路了,請幫
void DisplayWeatherData(void)
{
double temperature,humidity,pressure,windspeed,direction,bt,bp,bw;
temperature = GetTemperature;
humidity = GetHumidity;
pressure = GetPressure;
windspeed = GetWindspeed;
direction = GetWindDirection;
bt = (temperature * 9.0/5.0) + 32.0;
bp = pressure * KPATOINHG;
bw = windspeed * KMTOMPH;
printf("\nTemperature: %4.1lf C\tHumidity: %3.0lf%%\tPressure: %4.1lf kPa\n",temperature,humidity,pressure);
printf("Windspeed: %3.0lf km/hr\tDirection: %3.0lf Degrees\n\n",windspeed,direction);
printf("\nTemperature: %4.1lf F\tHumidity: %3.0lf%%\tPressure: %4.1lf inHg\n",bt,humidity,bp);
printf("Windspeed: %3.0lf mph\tDirection: %3.0lf Degrees\n\n",bw,direction);
}
double GetTemperature(void)
{
return 25.1;
}
double GetHumidity(void)
{
return 55.4;
}
double GetPressure(void)
{
return 101.7;
}
double GetWindspeed(void)
{
return 15.5;
}
double GetWindDirection(void)
{
return 320.0;
}
簡單錯字errors.'GetTemperature' - >'GetTemperature()'' – kaylum
溫度= GetTemperature;' - >'溫度= GetTemperature();'等上。 –