Recursion subsequences

why is this code not printing the substrings and instead printing just spaces…

Dhruv, pls use the following approach for printing the subsequences as :

( You need to use string instead of character array…)

void printsubsequences(string str,string osf)
{
if(str.length()==0)
{
cout<<osf<<" ";
return;
}
char ch=str[0];
string ros=str.substr(1);
printsubsequences(ros,osf);
printsubsequences(ros,osf+ch);
}