Code not working

I am finding all possible permutations and comparing each with the original string ,if greater I print it, what is the fault in this code.

#include
#include
using namespace std;
void permute(char *in, int i, string str)
{
if (in[i] == ‘\0’)
{
if (in > str)
{
cout << in << endl;
}
return;
}
// Rec case
for (int j = i; in[j] != ‘\0’; j++)
{
swap(in[i], in[j]);
permute(in, i + 1, str);
swap(in[j], in[i]);
}
}

int main()
{
char in[100];
cin >> in;
string str;
str = in;
permute(in, 0, str);

return 0;

}

refer this https://ide.codingblocks.com/s/580272

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.

Can you please explain why my code is not working , I am finding all possible permutations and comparing each with the original string ,if greater I print it, what is the fault in this code.

In question it is mentioned the output strings must be lexicographically sorted.
Consider Input abc.
ur output
acb
bac
bca
cba
cab

expected output
acb
bac
bca
cab
cba

thanks I got it!..