Skip to content

Issue in "Podstawy OOP | 0x14 override" #108

Closed
@LechWilk

Description

@LechWilk

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions