cpp:stl:container_common_functions
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
cpp:stl:container_common_functions [2020/05/29 09:36] – gthanos | cpp:stl:container_common_functions [2020/05/29 10:54] – [Αναζήτηση στοιχείου] gthanos | ||
---|---|---|---|
Line 284: | Line 284: | ||
Όλες οι παραλλαγές της συνάρτησης //find// επιστρέφουν έναν // | Όλες οι παραλλαγές της συνάρτησης //find// επιστρέφουν έναν // | ||
</ | </ | ||
+ | |||
+ | ===== Ανάθεση των περιεχομένων ενός container από τα περιεχόμενα οποιουδήποτε άλλου container ===== | ||
+ | |||
+ | Η ανάθεση των περιεχομένων ενός // | ||
+ | |||
+ | <code cpp vector_assign.cpp> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | using namespace std; | ||
+ | |||
+ | template< | ||
+ | void print(vector< | ||
+ | for(auto it = v.cbegin(); it!=v.cend(); | ||
+ | cout << setw(3) << *it; | ||
+ | cout << endl; | ||
+ | } | ||
+ | |||
+ | int main () { | ||
+ | vector< | ||
+ | array< | ||
+ | |||
+ | v.assign(a.begin()+1, | ||
+ | | ||
+ | print(v); | ||
+ | } | ||
+ | </ | ||
+ | |||
cpp/stl/container_common_functions.txt · Last modified: 2023/05/30 19:18 by gthanos