copy a number to a vector c code example
Example 1: copy a part of a vector in another in c++
// Copying vector by copy function
copy(vect1.begin(), vect1.end(), back_inserter(vect2));
Example 2: copy array of integers in c
int * intdup(int const * src, size_t len)
{
int * p = malloc(len * sizeof(int));
memcpy(p, src, len * sizeof(int));
return p;
}