read substring by reverse

how i can read reverse what display by substring............?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <iostream>
#include <string>
using namespace std;

int main()
{
	string str = "Hello World";
	
	string s = str.substr(0, 6);
	
	reverse(s.begin(), s.end());
	
	cout << "Substring reversed = " << s << endl;
	
	return 0;
}
Best not to give answers for free like that.
He didn't, this only works if you are looking to switch the first and last words in a two word string :p. There is no mobility for this code so it shows oman the fish without handing it over. He would be better off loading the input into a string array and outputting the array in reverse, is this giving away TMI?
Actually he is giving away the answer. Sure he is not giving the EXACT answer, but he is giving enough to make it so oman doesn't have to try at all.
Topic archived. No new replies allowed.