copy array 2 times in a single array vector c++ code example
Example: how to create a vector from elements of an existing vector in cpp
// Initializing vector with values
vector<int> vect1{1, 2, 3, 4};
// Declaring another vector
vector<int> vect2;
// Copying vector by assign function
vect2.assign(vect1.begin(), vect1.end());