Initializating animal when copying

This commit is contained in:
2025-11-21 11:39:22 +01:00
parent 9735e67e32
commit 45fd66c71c
4 changed files with 9 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ Dog::~Dog()
std::cout << "Dog has been destroyed" << std::endl;
}
Dog::Dog(const Dog &other)
Dog::Dog(const Dog &other) : Animal(other)
{
std::cout << "Dog copied" << std::endl;
*this = other;