Need help virtual inheritence

Running this program, but it says Person is an ambiguous base of StaffST. How do u solve this? I know its virtual inheritance, but which one class do I put it on? Here are all the classes that are related to this problem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//Person Class
 #ifndef PERSON_H
#define PERSON_H

#include <string>

using namespace std;

class Person
{
public:
	Person();
	Person(string n, string a, string t, string e);
	string getName();
	string getAddress();
	string getTelephone();
	string getEmail();
	virtual string whatami();
private:
	string name;
	string address;
	string telephone;
	string email;
};
#endif


//Student Class
#ifndef STUDENT_H
#define STUDENT_H

#include "Person.h"
#include <string>

using namespace std;

class Student: public Person
{
public:
	Student();
	Student(string n, string a, string t, string e, string s);
	string getStatus();
	virtual string whatami();
	
private:
	string status;
};
#endif


//Staff Class
#ifndef STAFF_H
#define STAFF_H

#include "Employee.h"

using namespace std;

class Staff: public Employee
{
public:
	Staff();
	Staff(string n, string a, string t, string e, string o, string s, string dh, string ttl);
	string getTitle();
	virtual string whatami();
	
private:
	string title;
	
};
#endif


//Employee Class
#ifndef EMPLOYEE_H
#define EMPLOYEE_H

#include <string>
#include "Person.h"

using namespace std;

class Employee: public Person
{
public:
	Employee();
	Employee(string n, string a, string t, string e, string o, string s, string dh);
	string getOffice();
	string getSalary();
	string getDateHired();
	virtual string whatami();
private:
	string office;
	string salary;
	string dateHired;

};
#endif

//StaffST CLASS

class StaffST: public Student, public Staff
{
public:
       StaffST();
       StaffST(string n, string a, string t, string e, string s, string o, string slry, string dh, string ttl, int ch);
       int getCreditHours();
       virtual string whatami();
private:
       int creditHours;      
}
#endif


Last edited on
I don't see any problems with the inheritance. Where does the error occur?
Just updated the code. Sorry bout that
This is a duplicate of:

http://www.cplusplus.com/forum/beginner/211055/

and of:

http://www.cplusplus.com/forum/general/210962/

and of:

http://www.cplusplus.com/forum/general/211056/

Please don't spam the forum with multiple threads for the same question. It wastes people's time and effort.
Topic archived. No new replies allowed.