logo

Crowdly

Browser

Add to Chrome

Quel est le problème dans le code suivant impliquant l'héritage en C++ ? clas...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Quel est le problème dans le code suivant impliquant l'héritage en C++ ?

class Animal {

public:

void eat() {

cout << "Animal is eating" << endl;

}

};

class Bird : public Animal {

public:

void fly() {

cout << "Bird is flying" << endl;

}

};

class Dog : public Animal {

public:

void bark() {

cout << "Dog is barking" << endl;

}

};

int main() {

Bird b;

b.eat();

b.fly();

Dog d;

d.eat();

d.bark();

return 0;

}

0%
0%
100%
0%
More questions like this

Want instant access to all verified answers on moodle.inp-toulouse.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome