All pastes #715386 Raw Edit

Mine

public text v1 · immutable
#715386 ·published 2007-09-26 07:52 UTC
rendered paste body
#include <iostream>
using namespace std;

class Cat                   // begin declaration of the class
{
  public:                   // begin public section
    int GetAge();           // accessor function
    void SetAge (int age);  // accessor function
    void Meow();            // general function
  private:                  // begin private section
    int itsAge;             // member variable
};

int Cat::GetAge()
{
	return itsAge;
}

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

void Cat::Meow()
{
	cout << "Meow.\n";
}

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;
}