Animal, Dog and Cat classes created and finished

This commit is contained in:
2025-11-09 21:56:00 +01:00
parent 21a7edfacb
commit d893207a3c
8 changed files with 171 additions and 6 deletions

View File

@@ -40,3 +40,8 @@ void Animal::makeSound() const
{
std::cout << "Animal weird sounds..." << std::endl;
}
std::string Animal::getType() const
{
return (this->type);
}

View File

@@ -18,7 +18,7 @@
class Animal
{
private:
protected:
std::string type;
public:
Animal();
@@ -26,7 +26,8 @@ class Animal
Animal(const Animal &other);
Animal& operator=(const Animal &other);
virtual void makeSound() const;
virtual void makeSound() const;
std::string getType() const;
};
#endif