Error in this code

There’s issue with compilation and also with implementation. I would suggest you to take reference from this code

sir, i revised my code… i dont understand that why are we needing a vector to store the output entries generated by recursion and then we are using the find function for the vector

why cant we do it inplace by sending the output entries as strings to the find function which directly prints the required names for the external array of strings

You can do it without storing it in vector too, we were storing it in vector just because we were calculating all the possible possibilities, and then were checking for any string in finding function.

sir, what is the error in my revised code then… what part of the code is leading to its failure

Now see this


There were 2 mistakes

  1. That was in your else statement. If you are not getting searchIn[i] then you will check for next I+1 element, you won’t return
  2. In for loop it should not be size of searchIn[] , it should have been either 10 as it’s not a char array, it’s a string array which takes more size then 1 byte.

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.