I know what this error means, but how do I fix it? I'm using a if... else... function, so I'm not sure how to improve upon that. Thanks!
1 Answer
Your function is declared as having a return type, but the structure of your function is not guaranteed to return anything.
For example, if you have:
bool myfunction(int x)
{
if(x > 10)
{
return true;
}
}
That function has specified that it will return something, but if x <= 10, it will reach the end of the function without returning anything.