Reputation: 1863
I have defined two classes as follows:-
class DayStat
{
private:
double cases, deaths;
public:
DayStat();
DayStat(int _cases, int _deaths);
DayStat(const DayStat &d, double denominator);
double mortalityRate() const;
double getcases() const;
double getdeaths() const;
};
class Region
{
private:
DayStat *raw;
char *name;
int population;
int area;
int nday;
};
Now, I want to store the cases and deaths of the DayStat class which are private into the raw dynamic array being defined in the Region class. That is raw should store the cases and deaths of a region. But, I am not sure how to access the 2 private members (cases and deaths) from the DayStat class in the Region class. Any help would be appreciated! Thanks!
Upvotes: 1
Views: 87