Hey everyone, I am having a hell of at time with arrays of classes. In this case i want to send MothlyReport to WeatherReports compare member but I get the following error message : "Expected primary expression before ." that is in the WeatherReport.compare(MonthlyReport[i]) Can anyone please guide me?Code:void compare(WeatherReport Report); . . . for(i=0;i<DAYS;i++) { WeatherReport.compare(MonthlyReport[i]); } . . . void WeatherReport::compare(WeatherReport Report) { WeatherReport WeatherSummary; if (Report.HighTemp>WeatherSummary.HighTemp) WeatherSummary.HighTemp=Report.HighTemp; if (Report.LowTemp<WeatherSummary.LowTemp) WeatherSummary.LowTemp=Report.LowTemp; if (Report.AmountRain>WeatherSummary.AmountRain) WeatherSummary.AmountRain=Report.AmountRain; if (Report.AmountSnow>WeatherSummary.AmountSnow) WeatherSummary.AmountSnow=Report.AmountSnow; cout<<WeatherSummary; }
Thanks