Check out example codes for "c++ reverse string". It will help you in understanding the concepts better.

Code Example 1

#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main() {
	string s = "live";
  	reverse(s.begin(), s.end());
  	cout << s; //evil
  	return 0;
}

Code Example 2

// using reverse() 
#include <bits/stdc++.h> 
using namespace std; 

int main() 
{ 
    string str = "geeksforgeeks"; 
    reverse(str.begin(), str.end()); 
}

Learn ReactJs, React Native from akashmittal.com