Hello everybody!
I wrote the following classes:
OilStation:
class OilStation : public Date{
protected:
int code;
char *Address;
float Amount[K];
public:
...
};
and Price:
class Price : public OilStation {
public:
Price(){}
void changeAmount();
...
};
In changeAmount function i try to change the elements that are stored in array Amount, but the protected array Amount of class OilStation isn't visible in the implementation file of class Price. Specifically, the error is: "error: Amount was not declared in this scope". I can't understand this, as class Price inherits class OilStation and protected members should be visible in public inheritance... Am i right? I also include the proper header files, so there is no such kind of a problem. Any idea would be appreciated... Thank you in advance for spending your time with me!