Mega Code Archive
Using the STL generic reverse algorithm with a string and assert the correctness
#include
#include
#include
#include // For reverse algorithm
using namespace std;
int main()
{
string string1 = "abc";
reverse(string1.begin(), string1.end());
assert (string1 == "cba");
return 0;
}