Hi Guys,
I am making a program on inheritance, I have made a small program of automobile and want to make sure that 2 cars(base class) inherit the characteristics of the parent class(Vehicle).
This is the extract from the program:
----------------------------------------------------------------------Code:class Vehicle
{
private:
int modelno;
char name;
public :
int getmodel();
int setmodel();
};
class Car:public Vehicle
{
};
I wanted to know that do I have to define the functions "int getmodel()" and "int setmodel()" in the base class "Car" or it will inherit these functions from the parent class "Vehicle"?
Will this class Car inherit the data members from the parent class "Vehicle" itself?
Thanks