copy a part of a vector in another in c++

C++
  // Copying vector by copy function 
copy(vect1.begin(), vect1.end(), back_inserter(vect2)); 
Source

Also in C++: