cpp:stl:containers
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
cpp:stl:containers [2020/05/28 15:16] – created gthanos | cpp:stl:containers [2020/05/29 08:13] – removed gthanos | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Κοινές συναρτήσεις για όλους τους containers ====== | ||
- | |||
- | ==== Εισαγωγή στοιχείου σε container ==== | ||
- | |||
- | Με εξαίρεση την κλάση [[array|std:: | ||
- | |||
- | Επιπλέον, | ||
- | |||
- | Παραδείγματα: | ||
- | |||
- | <code cpp student_list_insert.cpp> | ||
- | #include < | ||
- | #include < | ||
- | #include < | ||
- | #include " | ||
- | |||
- | int main () { | ||
- | Student students[] = { Student(" | ||
- | | ||
- | std::cerr << "----- Init list -----" << std::endl; | ||
- | std:: | ||
- | for(int i=0; i<2; i++) { | ||
- | mylist.insert(mylist.begin(), | ||
- | mylist.insert(mylist.end(), | ||
- | } | ||
- | | ||
- | mylist.emplace(mylist.end(), | ||
- | | ||
- | std::cerr << " | ||
- | std::cerr << " | ||
- | for (std:: | ||
- | std::cerr << ' ' << *it; | ||
- | std::cerr << std::endl; | ||
- | std::cerr << " | ||
- | | ||
- | return 0; | ||
- | } | ||
- | </ | ||
cpp/stl/containers.txt · Last modified: 2022/05/26 16:49 by gthanos