I am new to c++ programming.
I want to create a program which includes the following line of codes
Code:
class cars
{
.
.
.
};
class PatrolCars:public cars
{
.
.
.
};
class CNGCars:public cars
{
.
.
.
};
now what the problem is that i want to write a member function which can copy each of the drive class objects to each other I mean these lines should be valid
Code:
PatrolCars patcar;
CNGCars cngcar;
patcar=cngcar;
should i create a copy constructor or should i overload an operator for this?
plz help!