cpp:stl:containers
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:stl:containers [2020/05/28 16:36] – [Διαγραφή στοιχείου] gthanos | cpp:stl:containers [2020/05/28 16:40] – [Διαγραφή στοιχείου] gthanos | ||
---|---|---|---|
Line 128: | Line 128: | ||
for (int i=1; i<10; i++) myset.insert(i*10); | for (int i=1; i<10; i++) myset.insert(i*10); | ||
- | it = myset.begin(); | + | it = myset.begin(); |
- | ++it; // | + | // ^ |
+ | ++it; // | ||
+ | // | ||
- | myset.erase (it); | + | myset.erase (it); // 10 30 40 50 60 70 80 90 |
- | myset.erase (40); | + | myset.erase (40); // 10 30 50 60 70 80 90 |
- | it = myset.find (60); | + | it = myset.find (60); // 10 30 50 60 70 80 90 |
- | myset.erase (it, myset.end()); | + | // ^ |
+ | myset.erase (it, myset.end()); | ||
std::cout << "myset contains:"; | std::cout << "myset contains:"; |
cpp/stl/containers.txt · Last modified: 2022/05/26 16:49 by gthanos