please point out my mistakes
Https://ide.codingblocks.com/s/300447
mistake is in find function
i have done some modification in your code
you can see them in modified code below
Modified Code
if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like : and don’t forgot to mark doubt as resolved
i see , now my code gives the correct output but i didnt get how line 13’s if statement is really working ,please explain the modification you have done,thank you!!
if(s[i].find(s1)!=string::npos){
cout<<s[i]<<endl;
return;
}
s[i].find(s1) this will find the string s1 inside s[i]
The position of the first character of the first match.
If no matches were found, the function returns string::npos
if the s1 find in s[i] then it print s[i] and return;
i hope this helps