I have the following code:
ostream Person::operator<<(ostream& out, const Person& p)
{
out << "/n*********************************" << endl;
out << "Name: " << Person::getName() << endl;
out << "Age: " << Person::getAge() << endl;
out << "Health: " << Person::getHealthLevel() << "%" << endl;
out << "Happiness: " << Person::getHappinessLevel() << "pts" << endl;
out << "Sleep: " << Person::getSleepLevel() << "%" << endl;
out << "Money: " << "$" << Person::getMoneyLevel() << endl;
out << "Posessions: " << endl;
out << "*********************************" << endl;
return out;
}
It looks correct to me, but I'm getting a few errors:
`Person::operator <<(ostream &, const Person &)' must take exactly one argument
new declaration `class ostream Person::operator <<(ostream &, const Person &)'
ambiguates old declaration `class ostream & Person::operator <<(ostream &, const Person &)'
In method `ostream::ostream(const ostream &)':
`ios::ios(const ios &)' is private
within this context
Is there something I'm doing wrong?