26.7k views
2 votes
Write a function called printbackwards() that will work with a c++ string

1 Answer

3 votes
There is a standard reverser that will work for this:

void printbackwards(string s)
{
reverse(s.begin(), s.end());
cout << s;
}


User ChessMax
by
7.1k points