Sto provando a compilare il mio codice per testare una funzione per leggere e stampare un file di dati, ma ottengo un errore di compilazione che non capisco - "errore: costruttore, distruttore o conversione prevista prima di"; " gettone". Il muro del codice-codice rilevante è sotto.Errore: costruttore previsto, distruttore o conversione del tipo prima di ';' gettone?
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
Non puoi chiamare semplicemente GetMonth() qui. inserirlo in main() .... – alexkr