#include <iostream>
// Base class
class Animal {
public:
std::string gender;
int age;
};
// Derived class
class Dog: public Animal {
public:
std::string breed;
void sound() {
std::cout << "Woof
";
}
};
int main() {
Dog buddy;
buddy.gender = "male";
buddy.age = 8;
buddy.breed = "husky";
buddy.sound(); // Outputs: Woof
return 0;
}