Need help: Ambiguity problem

//Hi Im trying to figure out how to get rid of this ambiguity. After running the program, it states that "Person is an ambiguous base of StaffST." I know about virtual inheritance but I don't know which class to place them in. The classes involved are below. Thanks for any help.

/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 the class StaffST.
Just updated the code with the StaffST class. Sorry bout that
This is a duplicate of:

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

and of:

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

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.