voidDog::run(void) { cout << "The dog " + dog_name + " is running!" << endl; }
// 主函数 intmain() { Dog dog1("Mark"); dog1.set(5.6, 3); cout << "The name of dog1 is " << dog1.dog_name << endl; cout << "The weight of dog1 is " << dog1.dog_weight << endl; cout << "The age of dog1 is " << dog1.dog_age << endl; dog1.run();