Próbuję skompilować mój kod, aby przetestować funkcję odczytu i wydruku pliku danych, ale pojawia się błąd kompilacji, którego nie rozumiem - "błąd: oczekiwany konstruktor, destruktor lub konwersja typu przed"; znak". Ściana odpowiedniego kodu-tekstu znajduje się poniżej.Błąd: oczekiwany konstruktor, destruktor lub konwersja typu przed ';' znak?
struct Day
{
int DayNum;
int TempMax;
int TempMin;
double Precip;
int TempRange;
};
struct Month
{
Day Days[31];
int MonthMaxTemp;
int MonthMinTemp;
double TotalPrecip;
int MonthMaxTempRange;
int MonthMinTempRange;
double AverageMaxTemp;
double AverageMinTemp;
int RainyDays;
double AveragePrecip;
}theMonth;
double GetMonth();
double GetMonth()
{
for (int Today = 1; Today < 31; Today++)
{
cout << theMonth.Days[Today].TempMax << theMonth.Days[Today].TempMin;
cout << theMonth.Days[Today].Precip;
}
return 0;
}
GetMonth(); // compile error reported here
Nie możesz po prostu wywołać metody GetMonth() tutaj. umieścić go w głównej() .... – alexkr