Hi Guys,
I want to know about inheritance in a program of vehicle which I had before.
The program is as:
--------------------------------------------------------------------
--------------------------------------------------------------------------Code:class Vehicle { private: char name; int regno; public: void getname(); void regno(); }; class Car :Vehicle { public: ------ }
I wanted to know that if we just write the child class for car as "class Car: Vehicle" and don't use "public" in this code,then will the child class be able to access the public members of the class "Vehicle"?
Also do child classes only access the public members of the parent class?
Thanks