예제 #1
0
int main() {
  SimpleCat *Frisky = new SimpleCat();
  std::cout << "Frisky is " << Frisky->GetAge() << " years old\n";

  Frisky->SetAge(5);
  std::cout << "Frisky is " << Frisky->GetAge() << " years old\n";

  delete Frisky;
  return 0;
}
예제 #2
0
파일: main.cpp 프로젝트: IOFeed/JLiberty
int main()
{ 
  cout << "Making cat!" << "\n";
  SimpleCat Frisky;
  cout << "Cat age: " << Frisky.GetAge() << " yars" << "\n";
  int age = 5;
  Frisky.SetAge(age);
  FunctionTwo(Frisky);
  cout << "Cat age: " << Frisky.GetAge() << " yars" << "\n";
  
  cin.get();
  return(0);
}
예제 #3
0
int main()
{
  std::cout << "Making a cat ...\n";
  SimpleCat Frisky;
  std::cout << "Frisky is ";
  std::cout << Frisky.GetAge() << " years old\n";
  int age = 5;
  Frisky.SetAge(age);
  std::cout << "Frisky is ";
  std::cout << Frisky.GetAge() << " years old\n";
  std::cout << "Calling FunctionTwo ...\n";
  FunctionTwo(&Frisky);
  std::cout << "Frisky is ";
  std::cout << Frisky.GetAge() << " years old\n";
  return 0;
}