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