Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- class Person {
- public:
- Person(int x) {
- cout << "Person constructor" << endl;
- }
- };
- class Student : public Person {
- public:
- Student(int x) : Person(x) {
- cout << "Student constructor" << endl;
- }
- };
- class Professor : public Person {
- public:
- Professor(int x) : Person(x) {
- cout << "Professor constructor" << endl;
- }
- };
- class Faculty : public Student, public Professor {
- public:
- Faculty(int x) : Student(x), Professor(x) {
- cout << "Faculty" << endl;
- }
- };
- int main() {
- Faculty f(10);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement