[Solved] Return the longest common Substring Function c ++
You should change your if condition. string::find returns the position of the found string or string::npos if no string was found. string::find does not work with true and false. true is converted to 1. Therefor b.find(subString)== true is only true if subString is found at position 1 in b. You can verify this behavior with … Read more