Closed
Description
I guess we have wong calls here:
std::cout << birds_[0]->makeSound() << '\n';
std::cout << birds_[1]->makeSound() << '\n';
std::cout << birds_[2]->makeSound() << '\n';
Mothod makeSound() doesn't return any string to stream out in any override; instead of it already includes "std::cout":
class Goose : public Soundable {
public:
void makeSound() override { std::cout << "Honk! Honk!"; }
};
class Hen : public Soundable {
public:
void makeSound() override { std::cout << "Cluck! Cluck!"; }
};
class Duck : public Soundable {
public:
void makeSound() override { std::cout << "Quack! Quack!"; }
};
Metadata
Metadata
Assignees
Labels
No labels