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?
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.