I am trying to look at specific items (strings) in the object array and parse the strings but the error at weekData.at(i) says "expression must have class type but it has type "WeekData *" ".
double Stats::GetMean(WeekData weekData[], int num){
vector<string> dateV;
vector<int> deathV;
double mean = 0;
int total = 0;
for(int i = 0; i<num;i++){
string line = weekData.at(i); **//ERROR**
stringstream ss(line);
while(ss.good()) {
string week;
string death;
getline(ss, week, ',');
getline(ss, death, ',');
int deaths = atoi(death.c_str());
dateV.push_back(week);
deathV.push_back(deaths);
total = total+deaths;
}
}
return mean = total/num;
}
The error at weekData.at(i) says "expression must have class type but it has type "WeekData *" ".