I want to move the first 2 elements to given position in vector, the result is not right by using memmove
in following code:
vector<int> v{1, 2, 3, 4, 0};
memmove(&(v[3]), &(v[0]), 2);
The result by doing so is 1, 2, 3, 1, 0
, while the expectation is 1, 2, 3, 1, 2
. How can I achieve my job?