Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Vehicle {
- public:
- Vehicle() {
- cout << "Vehicle" << endl;
- }
- };
- class four_wheels : public Vehicle {
- public:
- four_wheels() : Vehicle() {
- cout << "Four wheels" << endl;
- }
- };
- class Car : public four_wheels {
- public:
- Car() : four_wheels() {
- cout << "Car" << endl;
- }
- };
- int main()
- {
- Car c;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement