Lesson 17 of 24
Inheritance
10 min 35 XP
class Car : public Vehicle gives Car the public and protected members of Vehicle. The derived constructor calls the base constructor in its initializer list. C++ even supports multiple inheritance.
Example: edit me and press Run
Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.