Hello for my friends in daniweb
class X
{
public:
virtual void function( ) = 0;
protected:
int x,y;
color cl;
X-type type;
char a;
};
class X is abstract class.
class Y : public X
{
private:
int counter;
}
class Z : public X
{
private:
int h, s;
}
-----------------------------
i want to copy object of derived class to base class
how can i overload operator = that copy private member of derived class in base class;
example:
x* arr[10][10];
arr[2][2] = new Y( constructor of class Y );
arr[3][2] = arr [2][2];
that operator = just copy counter, cl, type, a of arr[2][2] to arr[3][2]
and how i can initialize to x=3,y=2 of arr[3][2] or x=2, y=2 of arr[2][2]
example2:
arr[5][5] = new Z( constructr of class Z );
arr[a][b] = arr[5][5];
that a,b variables that user enter
how i overload operator = for these 3 classes that copy priavate member of derived class 1( Y ) to
derived class2( Z ) or copy derived class to base class
i can't find topic operator overloading with inheritance in the books if you
know books that describe his topic pleas introduce me that book
thank's