Where am i going wrong?

I think my approach is right, please help me figure out the problem

please share your code after saving it on ide.codingblocks.com

Hii I have saved the code on server, please do check

you need to design the search functionality. And if no such words are available for a given search word, add this word to your dictionary.
add this

Yeah i got the problem, but i wanted to know where am I going wrong with my approach(Problem in my code)?