My doubt is , when I am passing string array to a function it does not reflect changes in main function as you can see. But it is updating the value in the function please go through the cout statement in line no. 18.
https://ide.codingblocks.com/s/188705
Please tell me how to reflect changes in main function in string array. I am storing all the keypad combinations. And one more thing do I need to check all the keypad combinations and find the corresponding string after comparing. Is there any function know sub string of other??
Wrong output wrong output
hi Raj if you try printing the value of out[k] you will see that nothing is being printed which means that the value of out is not being updated inside the function also, hence no changes are being reflected.
There is a substr function for strings, you can use that for generating substrings of a given string.
You can consider using the append or insert function of string STL for updating the values of out[i] as overloading the + operator is defined for only concatenation. for any other purpose it might give unexpected results.
also what you are really doing in line 18 is adding two characters and when you add 2 characters like that, their ascii values are added and they get converted into some other unexpected character.
https://ide.codingblocks.com/s/188717 i have written this program to demonstrate that how adding two charcters and storing it in a string will not give the desired result.
oops , I made a blunder mistake , while printing output array I have given index K instead of I . I almost waste my 3-4 hours on a single question 
Just one more doubt , I have output array of all the combination , now I should Iterate over all the keypad combinations and names then find whether it is a substring or not? While checking substring should I use KMP or there is any inbuilt function like “contains in java” ?
you can use substr function for finding substrings. you can read more about it here http://www.cplusplus.com/reference/string/string/substr/
How?? I am really pissed off wasting most of the time in single problem, there is no hint video also. Please help me out.
Did you read the documentation link I provided? It provides multiple use case syntax along with examples as well. Can you tell me exactly where are you stuck?
Yes I read the documentation. I told you I have all the combination in 2D array. like 34 { DG,DH,DI,EG,EH,EI,FG,FH,FI} Now I have to search all these combination whether they are substring of any of the name given in searchIn[] { string searchIn [] = { “prateek”, “sneha”, “deepak”, “arnav”, “shikha”, “palak”, “utkarsh”, “divyam”, “vidhi”, “sparsh”, “akku” }; Should I use two loops to traverse on combinations and searchin[] string , then find the whether combination is subtring of any name given in searchin[] . For finding substring If I use another two loops then time complexity goes n^4 . Tell me the efficient approach.
you can see What I have in the array and what i want to do after that . https://ide.codingblocks.com/s/189151
@raj.verma5454 you can use the string::find function for that purpose http://www.cplusplus.com/reference/string/string/find/
Thank you so much, finally.
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.