You can use the [] operator with a vector the same way you would in an array. You could implement this with a vector something like this (if you wanted to use more vector methods):
#include
const int halfelements = originalarray.size()/2; //use size to get size
vector farray(halfelements);
vector farray(halfelements);
for (int i = 0; i < halfelements; i++) {
farray.push_back(originalarray[i]); //adds element at i to the end of vector
}
for (int i = halfelements, x = 0; i < (halfelements * 2); i++, x++) {
sarray.push_back(originalarray[i]);
}
You can also use .at(index) to add bounds checking to the vector access.