What does “warning: not all control paths return a value” mean? (C++)

Your compiler isn’t smart enough to take into account that the only two options for side are left and right, so it thinks it’s possible for neither return statement to be executed. When side is neither left nor right, your function doesn’t say which value to return.

Leave a Comment