A reverse function is integrated into C++ and can be used to reverse a string.
This function accepts two parameters:
The start iterator for the string
The string iterator has come to an end.
The following line of code demonstrates how to use this function:
#include <iostream>
//The library below must be included for the reverse function to work
#include<bits/stdc++.h>
using namespace std;
int main() {
string greeting = "Hello";
//Note that it takes the iterators to the start and end of the string as arguments
reverse(greeting.begin(),greeting.end());
cout<<greeting<<endl;
}