Please resolve the error in the code

there is a problem with the set statement

#include
#include
#include
using namespace std;
void perm(char *in,int i , set &s)
{
if (in[i]==’\0’)
{//cout<<in<<endl;
string t(in);
s.insert(t);
}

for(int j=i;in[j]!='\0';j++ )
{
    swap(in[i],in[j]);
    perm(in,i+1,s);
    swap(in[i],in[j]);// this is backtracking
}

}
int main()
{
char in[100];
cin>>in;
set s;
perm(in,0,s);

for(auto str:s)
    cout<< str<<", ";
return 0;

}

hello @vishwajeetss861999
what issue u r facing?

it shows wrong output

@vishwajeetss861999
ur code is correct ,print each string is seprate line and it will work.