Use variable form chils class
Hi,
I'm new in c++. I want to use a public variable form the parent class but I'v got always the error
Expression must be a modifiable value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
class Shapes
{
private:
public:
float center[2];
virtual void draw() const = 0;
};
class Rect : public Shapes
{
private:
public:
void draw() const override;
};
void Rect::draw() const
{
center[0] = 1; // Expression must be a modifiable value
}
|
thank you
Topic archived. No new replies allowed.