From 39ab9319115c24afd7d3852ba8266e48732590b9 Mon Sep 17 00:00:00 2001 From: Manisha Kundnani <90680330+Manishak798@users.noreply.github.com> Date: Wed, 14 Feb 2024 09:02:51 +0530 Subject: [PATCH] Add files via upload --- OOPS/multipleinheritance.cpp | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 OOPS/multipleinheritance.cpp diff --git a/OOPS/multipleinheritance.cpp b/OOPS/multipleinheritance.cpp new file mode 100644 index 0000000..f5a56f6 --- /dev/null +++ b/OOPS/multipleinheritance.cpp @@ -0,0 +1,34 @@ +#include +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; +} \ No newline at end of file