can anybody suggest me whats wrong with the code??
#include<iostream>
#include<string>
using namespace std;
void rev_str(string str,int n)
{
while(str[n]!='\0')
rev_str(str,++n);
cout<<str[n-1];
}
int main()
{
string str="shankhs";
rev_str(str,0);
return 0;
}
thanks