-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb4ec5e
commit 4ddc385
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Ex 1 | ||
|
||
- Créer une classe `Animal` qui contient une méthode `speak`. | ||
- Créer une classe `Dog` qui affiche `Wouf` sur la console lorsque la méthode | ||
`speak` est appelée. | ||
|
||
Le code suivant doit fonctionner. | ||
|
||
```cpp | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
cout << "The dog is here" << endl; | ||
Animal* a = new Dog(); | ||
a->speak(); | ||
} | ||
``` |