Shift the elements of an array

Hi all,

I have a function that I found on this forum: http://www.cplusplus.com/forum/general/16477/. This code writes the array on the same array as I understand. How can I keep the original array and write the shifted one into another array?

Thanks!
I suggest you to have a look at this:
http://www.cplusplus.com/reference/algorithm/rotate_copy/
yes, it does shift the elements but it updates the current array. Is it possible to write the shifted one into a new array?
yes, it does shift the elements but it updates the current array
No it's not. It is writing to anywhere you like. If you provide iterator to other arry, it will write to other array instead of overwriting current one.
Topic archived. No new replies allowed.