Not able to remove extra comma from the end

#include
using namespace std;

void sub(char n[],char out[],int i,int j)
{
if(n[i]==’\0’){
out[j]=’\0’;
cout<<out<<", ";

    return;
    
}

int fd=n[i]-'0';
char ch='a'+fd-1;
out[j]=ch;
sub(n,out,i+1,j+1);
if(n[i+1]!='\0'){
    int sd=n[i+1]-'0';
    int no=10*fd+sd;
    if(no<=26){
        char ch1='a'+no-1;
        out[j]=ch1;
        sub(n,out,i+2,j+1);

    }
}

}
int main(){
char n[100];

cin>>n;
char out[100];
 
cout<<"[";
 sub(n,out,0,0);

cout<<"]";

}

hi @madhuragarwal2027_a8d8220ac96f9af4,

is there any other way other than using vector

u need data structure which can resize and store all values, so vector is best option @madhuragarwal2027_a8d8220ac96f9af4 u can read about it, its similar to array