#include <iostream >
using namespace std;
class Cat
{ public:
int GetAge();
void SetAge(int age);
void Meow();
protected:
int itsAge;
};
int Cat::GetAge(){return itsAge;}
void Cat::SetAge(int age){itsAge=age;}
void Cat::Meow(){cout<<"Meow...\n";}
int _tmain(int argc, _TCHAR* argv[])
{
Cat frisky;
frisky.SetAge(5);
frisky.Meow();
cout <<"frisky is a cat who is "<<frisky.GetAge()<<" years old.\n";
frisky.Meow();
return 0;
}
怎么放到C++08中的头文件、源文件中去啊,各自文件要加什么东西?
高手指点一下