User Tools

Site Tools


cpp:stl:container_common_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
cpp:stl:container_common_functions [2022/05/26 18:58] – [Εισαγωγή στοιχείου] gthanoscpp:stl:container_common_functions [2022/06/01 03:35] – [Ανάθεση των περιεχομένων ενός container από τα περιεχόμενα ενός άλλου container] gthanos
Line 308: Line 308:
   vector<int> v;   vector<int> v;
   array<int,6> a = {10, 20, 30, 40, 50, 60};   array<int,6> a = {10, 20, 30, 40, 50, 60};
- 
-  v.assign(a.begin()+1, a.end()-1); 
      
 +  
 +  /* Assigns 20, 30, 40, 50
 +  
 +  v.assign(a.begin()+1, a.end()-1);      //    10         20      30      40      50       60
 +                                         //                                              ^
 +                                         //           begin()+1                         end()-1 
   print(v);    print(v); 
 } }
cpp/stl/container_common_functions.txt · Last modified: 2023/05/30 19:18 by gthanos