struct c++ programming?
i have used class before, but i don't know struct, could I know how to solve the error?
the error is coming from the last part, i cannot return the value.
- 1 month agoFavourite answer
The error messages tell you exactly what you're doing wrong. You defined a function that returns a Result struct, and the final line in that function does not return a Result struct. It returns an integer. Either change that return line to "return a;" or change the function definition to "int longestSubstring". That's what the language requires.