/* * multinheritance.cpp * * Created on: 16.05.2013 * Author: trifon */ #include using namespace std; #include "student.h" #include "employee.h" #include "intern.h" int main() { Student s("Иван Иванов", "1", 40000, 5.50); s.print(); Employee e("Петър Петров", "2", "Програмист", 1500); e.print(); Person& ps = s; cout << &s << ' ' << &ps << endl; Person& pe = e; cout << &s << ' ' << &pe << endl; Intern i("Иван Иванов", "1", 40001, 6.00, "Демонстратор", 100, 5); i.print(); Intern i2; i2 = i; i2.print(); Student& si = i; Employee& ei = i; si.setName("Студент"); ei.setName("Служител"); Person& pi = i; pi.setName("Човек"); cout << &i << ' ' << &si << ' ' << &ei << ' ' << &pi << endl; i.print(); cout << sizeof(Person) << endl; return 0; }