Recursion Dictionary Order smaller. please help with my code

#include
#include
#include
#include
using namespace std;
//vectorvect;
void permute(string,string,int);
int main() {
string str;
cin>>str;
string ostr;
ostr=str;
permute(str,ostr,0);
//sort(vect.begin(),vect.end());
//cout<<vect[0]<<endl;
//for (int l=1;l<vect.size();l++)
//{
// if(vect[l]!=vect[l-1])
// cout <<vect[l]<<endl;
//}
return 0;
}
void permute(string str,string ostr,int i)
{
if(ostr[i]==’\0’){
if(ostr<str)
//vect.push_back(ostr);
cout<<ostr<<endl;
return;
}
for(int j=i;ostr[j]!=’\0’;j++)
{
swap(ostr[i],ostr[j]);
permute(str,ostr,i+1);
//swap(ostr[i],ostr[j]);
}
}

code

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.