this just prints the string s in reverse.
cout<<"enter size of string:";
for (int i = 0; i < n; i++)
if you meant that the variable b is the string i don't think you should use it in the loop.
hope this helped