commit:2011:10_29
Differences
This shows you the differences between two versions of the page.
| commit:2011:10_29 [2011/11/04 18:04] – créée biotteau | commit:2011:10_29 [2016/03/30 15:23] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Commit 2011-11-29 ===== | ||
| + | Correction du vecteur Oofelie. Le " | ||
| + | |||
| + | ===== Comportement classique C++ ===== | ||
| + | |||
| + | Pour un std:: | ||
| + | |||
| + | ===== Comportement du vecteur Offelie ===== | ||
| + | |||
| + | Pour le vecteur Oofelie, les données n' | ||
| + | - On désalloue le vecteur | ||
| + | - On en réalloue un nouveau. | ||
| + | |||
| + | Si l' | ||
| + | |||
| + | ===== Correctif ===== | ||
| + | |||
| + | J'ai changé la fonction resize pour qu' | ||
| + | |||
| + | Le comportement est donc le suivant : | ||
| + | |||
| + | < | ||
| + | for(int i = 1 ; i < 9 ; i ++) | ||
| + | | ||
| + | Fint.write(std:: | ||
| + | Fint.resize(3); | ||
| + | Fint.write(std:: | ||
| + | Fint.resize(5); | ||
| + | Fint.write(std:: | ||
| + | |||
| + | |||
| + | Donnera en sortie : | ||
| + | |||
| + | < | ||
| + | Fint = [1 2 3 4 5 6 7 8] | ||
| + | Fint = [1 2 3] | ||
| + | Fint = [1 2 3 0 0]</ | ||
