cpp:stl:vector
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:stl:vector [2020/05/29 10:35] – [Ένθεση στον πίνακα] gthanos | cpp:stl:vector [2020/05/29 10:38] – [Διαγραφή των περιεχομένων του πίνακα] gthanos | ||
---|---|---|---|
Line 135: | Line 135: | ||
| | ||
while(ints.size() > 0) { | while(ints.size() > 0) { | ||
- | auto pos = ints.begin() + ints.size()/ | + | auto middle |
- | ints.erase(pos, pos+2); | + | ints.erase(middle, middle+2); // erase position |
print(ints); | print(ints); | ||
} | } | ||
Line 201: | Line 201: | ||
print(ints); | print(ints); | ||
| | ||
- | | + | ints.erase(ints.begin(), |
- | | + | print(ints); |
- | print(ints); | + | |
- | } | + | |
} | } | ||
</ | </ |
cpp/stl/vector.txt · Last modified: 2023/05/29 19:12 by gthanos