char * recursivecombo(char *str, int choices, int level)
{
int len = strlen(str);
level++;
if( level == choices)
{
for (int i = 0; i < len -2; i++)
{
printf("%c", str[i]) ;
}
}
else
{
for (int i = 0; i < len - 2; i++)
{
printf("%c",str[i]);
recursivecombo(str.substr(1), level);
}
}
}
I want to use string instead of char*.