How is this undeclared?
I keep on getting this error. And its pissing me off. Dont know how to fix
[php]class Employee
{
public:
int GetAge(); //Accessor Functions
int GetYears();
int GetSalary();
void SetAge(int age);
void SetYears(int years);
void SetSalary(int salary);
private:
int itsAge;
int itsYears; //years worked
int itsSalary;
};
//Set Functions --------
void Employee::SetAge(int age)
{
itsAge = age;
}
void Employee::SetYears(int years)
{
itsYears = years;
}
void Employee::SetSalary(int salary)
{
itsSalary = salary;
}
//Get Functions ---------
int Employee::GetAge() //get age of employee
{
return age;
}
int Employee::GetYears() //get years worked
{
return years;
}
int Employee::GetSalary()
{
return salary;
}
[/php]
Code:
1>c:\users\patrick\documents\visual studio 2008\projects\10-1\10-1\employee.h(35) : error C2065: 'age' : undeclared identifier 1>c:\users\patrick\documents\visual studio 2008\projects\10-1\10-1\employee.h(40) : error C2065: 'years' : undeclared identifier 1>c:\users\patrick\documents\visual studio 2008\projects\10-1\10-1\employee.h(45) : error C2065: 'salary' : undeclared identifier
{
public:
int GetAge(); //Accessor Functions
int GetYears();
int GetSalary();
void SetAge(int age);
void SetYears(int years);
void SetSalary(int salary);
private:
int itsAge;
int itsYears; //years worked
int itsSalary;
};
//Set Functions --------
void Employee::SetAge(int age)
{
itsAge = age;
}
void Employee::SetYears(int years)
{
itsYears = years;
}
void Employee::SetSalary(int salary)
{
itsSalary = salary;
}
//Get Functions ---------
int Employee::GetAge() //get age of employee
{
return age;
}
int Employee::GetYears() //get years worked
{
return years;
}
int Employee::GetSalary()
{
return salary;
}
[/php]

Or do you know me through my brother? 