Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to copy one vector to another

// C++ code to demonstrate copy of vector
// by assign() and copy().
#include<algorithm> // for copy() and assign()
#include<iterator> // for back_inserter
using namespace std;
  
    // Copying vector by copy function
    copy(vect1.begin(), vect1.end(), back_inserter(vect2));
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #copy #vector
ADD COMMENT
Topic
Name
2+1 =