Weird class/derived class error

Write your question here.
#ifndef EMPLOYEE_H_INCLUDED
#define EMPLOYEE_H_INCLUDED

class Employee
{
public:
Employee();
void setEmployee(string [], string [], string []);
string getEmployee();
protected:
string Name[10];
string Salary[10];
string Year_Hired[10];
};

#endif // EMPLOYEE_H_INCLUDED

#include <iostream>
#include "Employee.h"

Employee::Employee()
{

}
void Employee::setEmployee(string name[], string salary[], string year_hired[])
{
for(int i=0; i <5; i++)
{
Name[i]=name[i];
Salary[i]= salary[i];
Year_Hired[i]=year_hired[i];
}

}
void Employee::printEmployee()
{
for(int i = 0; i <5; i++)
{
cout<<"Name:"<<Name[i]<<", "<<"Salary:"<<Salary[i]<<", "<<"Year Hired:"<<Year_Hired[i]<<endl;
}
}


Here is the error ||=== Build file: "no target" in "no project" (compiler: unknown) ===|
G:\New folder (3)\Managers\Employee.h|8|error: variable or field `setEmployee' declared void|
G:\New folder (3)\Managers\Employee.h|8|error: expected `;' before '(' token|
G:\New folder (3)\Managers\Employee.h|9|error: `string' does not name a type|
G:\New folder (3)\Managers\Employee.h|11|error: `string' does not name a type|
G:\New folder (3)\Managers\Employee.h|12|error: `string' does not name a type|
G:\New folder (3)\Managers\Employee.h|13|error: `string' does not name a type|
G:\New folder (3)\Managers\Staff.h|8|error: variable or field `setStaff' declared void|
G:\New folder (3)\Managers\Staff.h|8|error: expected `;' before '(' token|
G:\New folder (3)\Managers\Staff.h|11|error: `string' does not name a type|
G:\New folder (3)\Managers\Staff.h|14|error: `string' does not name a type|
G:\New folder (3)\Managers\main.cpp||In function `int main()':|
G:\New folder (3)\Managers\main.cpp|14|error: 'class Employee' has no member named 'setEmployee'|
G:\New folder (3)\Managers\main.cpp|15|error: 'class Employee' has no member named 'printEmployee'|
G:\New folder (3)\Managers\main.cpp|19|error: 'class Manager' has no member named 'setStaff'|
G:\New folder (3)\Managers\main.cpp|25|error: 'class Manager' has no member named 'setStaff'|
||=== Build failed: 14 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|


Can someone please advise me on what is wrong???
From what I can see you forgot to include string and that it's part of namespace std. Also it seems that your missing some methods in your Employee class.

Private message me if you need some additional help.
Topic archived. No new replies allowed.