Possible Duplicate:
Rotate a string in c++?
How to rotate a std::string?
I am making a application in c++ that works with Command line input. I am entering a string in to the command line
int main(int argc, char** argv)
{
if(argc != 2)
{
cerr << "Invalid number of CMD arguments" << endl;
return 1;
}
string StringValue = argv[1];
cout << StringValue << endl;
}
This work’s fine. Now i want to loop the character in the string.
Example: if i enter the word “STATES”.
^STATES|
|^STATES
S|^STATE
ES|^STAT
TES|^STA
ATES|^ST
TETES|^S
STATES|^
Where “^” was the start and “|” the end. how do i do this?
use
std::rotatehttp://www.cplusplus.com/reference/algorithm/rotate/