sdasdsdas

asdadqesad
Last edited on
adsadasdasd
Last edited on
'Car' should be a child class of 'Vehicle'. This is done outside of main().
Last edited on
sadsadasdasdasd

}
Last edited on
but the problem here is,i dont know how to call the car class bcuz the car class has the platenumber variable...i dont know how to call both parent and child into main.Pls help me anyone..thanks in advance
Consult your favorite C++ book on inheritance.

If car inherits 'public' from vehicle, you can call all public methods of vehicle on an instance of car, since it IS an instance of vehicle as well.

Bonus hint: inside the display() method of car you could call the display() method of vehicle.
sadsadsad
Last edited on
Topic archived. No new replies allowed.