This code dosen't give any output

#include<bits/stdc++.h>
using namespace std;

void permute(char *a, int i, set<string> s)
{
    if(a[i] == '\0')
    {
        string t(a);
        s.insert(t);
        return;
    }

    for(int j = i; a[j] != '\0'; j++)
    {
        swap(a[i], a[j]);
        permute(a, i + 1, s);
        swap(a[i], a[j]);
    }
}

int main()
{
    char a[100];
    cin >> a;
    set<string> s;
    permute(a, 0, s);

    for(auto str:s)
    {
        cout << str << ",";
    }
}

hello @tAkshat
pass ur set by reference

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.