There is a function std::rotate() in <algorithm> (but you have to
set the last element yourself). Here is an example using
rotate with std::vector ... it also works with an array or CArray,
\but the call will be slightly different:
Code:std::vector<int> v; for (int i=0; i<6; ++i) { v.push_back(i+1); } std::rotate(v.begin(),v.begin()+1,v.end()); v[5] = 7;




Reply With Quote