I'm looking for a way to rotate a string in c++. I spend all of my time in python, so my c++ is very rusty.
Here is what I want it to do: if I have a string 'abcde' I want it changed to 'bcdea' (first character moved to the end). Here is how I did it in python:
def rotate(s):
return s[1:] + s[:1]
I'm not sure how to do it in cpp. Maybe use an array of chars?