Skip to content

Commit

Permalink
Add exercice 80-7
Browse files Browse the repository at this point in the history
  • Loading branch information
tony-maulaz committed Mar 14, 2022
1 parent 46ee7f1 commit 673235b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ex80-allocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,27 @@ void main(){
cout << "La valeur de tab[0] " << d.tab[0] << endl;
d.liberer();
}
```

# Ex 7

Quel est l'affichage du programme suivant :

```CPP
struct Parent
{
Parent() { cout << "Constr parent" << endl; }
virtual ~Parent() { cout << "Destr parent" << endl; }
};

struct Enfant: public Parent
{
Enfant() { cout << "Constr enfant" << endl; }
~Enfant() { cout << "Destr enfant" << endl; }
};

void ex2(){
Parent* p = new Enfant();
delete p;
}
```

0 comments on commit 673235b

Please sign in to comment.