Code:
#include <iostream.h>
class Cat
{
public:
int GetAge();
void SetAge(int Age);
int GetWeight();
void SetWeight(int Weight);
int Meow();
private:
int itsAge;
int itsWeight;
};
int Cat::Meow()
{
cout << "\nMeow!";
}
int main()
{
Cat Frisky;
Frisky.SetAge(5);
Frisky.Meow();
cout << "Frisky is a cat who is " ;
cout << Frisky.GetAge() << " years old.\n";
Frisky.Meow();
return 0;
}
When this code is compiled, I get these errors:
"Undefined reference to Cat::SetAge"
"Undefined reference to Cat::GetAge"
I looked into the problem, tried fixing it, only to encounter many more errors. Can somebody please help?
Thanks.
[code][/code]tagged by Salem