Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishak798 authored Feb 14, 2024
1 parent ebd2a0f commit 39ab931
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions OOPS/multipleinheritance.cpp
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;
}

0 comments on commit 39ab931

Please sign in to comment.