-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ebd2a0f
commit 39ab931
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#include <bits/stdc++.h> | ||
using namespace std; | ||
class Vehicle | ||
{ | ||
public: | ||
string brand = "ford"; | ||
void honk() | ||
{ | ||
cout << "tuut, tuut...."; | ||
} | ||
}; | ||
class Anotherbaseclass | ||
{ | ||
public: | ||
void func() | ||
{ | ||
cout << "some content of another base class"; | ||
} | ||
}; | ||
class Car : public Vehicle, public Anotherbaseclass | ||
{ | ||
public: | ||
string model = "Mustang"; | ||
}; | ||
int main() | ||
{ | ||
Car myObj; | ||
myObj.honk(); | ||
cout << endl; | ||
myObj.func(); | ||
cout << endl; | ||
cout << myObj.brand << " " << myObj.model; | ||
return 0; | ||
} |