How to implement Inheritance in C++ and resolve the error "parent class is not accessible base of child class"?
class
has private default inheritance, so you would need to specify public
, i.e.
class Ship : public Vehicle { }:
ans so on. struct
has public inheritance as default.