help????

So I've got this header code.

#include <iostream>
using namespace std;

class Employee
{
public:
int GetAge() const;
void SetAge(int age);
int GetYearsOfService() const;
void SetYearsOfService(int years);
int GetSalary() const;
void SetSalary(int salary);
private:
int itsAge;
int itsYearsOfService;
int itsSalary;
};


And then this executable code.

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

int Employee::GetAge() const
{
return itsAge;
}

void Employee::SetAge(int age)
{
itsAge = age;
}

int Employee::GetYearsOfService() const
{
return itsYearsOfService;
}

void Employee::SetYearsOfService(int years)
{
itsYearsOfService = years;
}

int Employee::GetSalary() const
{
return itsSalary;
}

void Employee::SetSalary(int salary)
{
itsSalary = salary;
}

int main()
{
using namespace std;

Employee John;
Employee Sally;

John.SetAge(30);
John.SetYearsOfService(5);
John.SetSalary(50000);

Sally.SetAge(32);
Sally.SetYearsOfService(8);
Sally.SetSalary(40000);

cout << "At AcmeSexist Company, two employees, John and Sally, work together.\n";
cout << "John is " << John.GetAge() << "years old.\n";
cout << "He worked with the Company for " << John.GetYearsOfService() << "years.\n";
cout << "He earns a salary of $" << John.GetSalary() << ".\n\n";
cout << "Sally is " << Sally.GetAge() << "years old.\n";
cout << "She worked with the Company for " << Sally.GetYearsOfService() << "years.\n";
cout << "Though she worked longer, she only earns a salary of $" << Sally.GetSalary << ".\n";
char response;
cin >> response;
return 0;
}


I try to build this and an error pops up.

error C3867: 'Employee::GetSalary': function call missing argument list; use '&Employee::GetSalary' to create a pointer to member

I made this program as a workshop in a c++ book to teach myself. this is actually almost the exact copy of the coy in the book that they give for the same compiler I'm using. I don't know what to do, because when I put "&" before Employee::GetSalary like it says to, more errors pop up. Can someone help me?


Error here (shown in bold):

cout << "Sally is " << Sally.GetAge() << "years old.\n";
cout << "She worked with the Company for " << Sally.GetYearsOfService() << "years.\n";
cout << "Though she worked longer, she only earns a salary of $" <<
Sally.GetSalary
<< ".\n";
thanks
Topic archived. No new replies allowed.