What I\'m trying to do:
I am trying to split a vector into two separate arrays. The current int vector contains an element per line in a text file. Th
If you can't use code from Xeo answer due to strict compiler rules or you want more generic way, try std::advance:
#include
#include
size_t middle = input.size()/2;
std::vector::const_iterator middleIter(input.cbegin());
std::advance(middleIter, middle);
std::vector leftHalf(input.begin(), middleIter);
std::vector rightHalf(middleIter, input.end());