String rotation

hi im trying to rotate a sting to the right, example "tomorrow" to look like this:

TOMORROW
OMORROWT
MORROWTO
ORROWTOM
RROWTOMO
ROWTOMOR
OWTOMORR
WTOMORRO
TOMORROW

Please help.
std::rotate
hi im new to c++, so how would i use that in my program, thank u.
1
2
3
4
5
6
std::string a="tomorrow"
for (int i=0; i<a.size(); i++)
{
     std::rotate(a.begin(), a.begin()+1, a.end());
     std::cout<<a<<std::endl;
     }

http://www.cplusplus.com/reference/algorithm/rotate/
UGHGRH THEESE THINGS MAKE ME SO ANGRY! Why on earth would you ant to erase your posts? Clearly you are new here, and know practicly nothing, sou you though you might as well erase all your posts so noone can know what you asked?! Really...
Thamsa says:
hi im trying to rotate a sting to the right, example "tomorrow" to look like this:

TOMORROW
OMORROWT
MORROWTO
ORROWTOM
RROWTOMO
ROWTOMOR
OWTOMORR
WTOMORRO
TOMORROW

Please help.

Topic archived. No new replies allowed.