Code doesn't work for the general cases. Some memory-related problems seem to be occuring

Hey @anshufirefox what is the name of the problem for which you have coded this for?

Subsequqnces generation recursion in which we print all the possible subsequences of a string (Subset based recursion)

Hey @anshufirefox have debugged it here, with comment for better understanding.

Q.1. Even cin doesn’t work with pointer approach??
Q.2. How to take input in a string if using char pointer for the string?

If you want to enter the words in char poniter, then make sure you give it some length. Like

char *a = new char [any size]

and then enter anything in it. Make sure if there is any space in between string then instead of char array, use string

You can run a for loop with the length required as much as you want to store it in char pointer. Just make sure you give it a size though

Thank you so much. There’s some glitch on my part. I am unable to close this thread using the mark resolved option. Could you please close the thread?

Yes i can, i would suggest you to report this thread too to [email protected] . Read more about gets, puts, getline, get ch and string and char. You will then easily differentiate which can be used when.

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.

Thanks again. Yeah, please do. I’ll report it. Also, once I finish recursion, I surely will go through the string part.

hello @anshufirefox
u have reopened ur doubt,pls let me know what issue u r facing now.

I was practicing the question again and wrote the code. It doesn’t work, can you please tell why.

I think it was because I by mistake put a semi colon after the if statement. It’s figured out most probably, could you confirm?

yes. . . . . . . . .
it was becuase of that only

Thanks a lot, the doubt is solved.

Could you please help me close this thread by sending the rating link? (I’m unable to close it by marking it as resolved. The button doesn’t work on my profile. Have reported it to the support team)

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.