Not able to sort the output

I am not able to sort the string according to output.
Here is my code:

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

void generateBrackets(int n,char out,int i,int open,int close, vector &v){
//bc
if(i==2
n){
out[i] = ‘\0’;
// cout<<out<<endl;
v.push_back(out);
}
//rc
if(open<n){
out[i] = ‘(’;
generateBrackets(n,out,i+1,open+1,close,v);
}
if(close<open){
out[i] = ‘)’;
generateBrackets(n,out,i+1,open,close+1,v);
}
}

int main() {
int n;
cin>>n;
char out[100];
vector v;
generateBrackets(n,out,0,0,0,v);
sort(v.begin(), v.end());
for (auto x : v)
cout << x << endl;
return 0;
}

Hello @king-slayer97 please share your code by saving it in ide.codingblocks.com

@king-slayer97 check this is your corrected 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.