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