Are you trying to do something like this?
int array[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
std::vector<int> fst(&array[0], &array[5]);
std::vector<int> snd(&array[5], &array[10]);
This will create a vector fstcontaining the first five elements array, and the vector sndcontains the rest.
source
share