- #1
torquerotates
- 207
- 0
Homework Statement
I'm just trying to interpert how the return statement works.bool check(int item, vector<int>& v2)
{ int i = 0;
while (i < v2.size())
{ if (item == v2)
return true;
i++;
}return false;
}
Homework Equations
The Attempt at a Solution
I'm confused about the return parts of this problem. I does the return false even get excecuted? I thought that once a return statement is reached in a function, the function exits. Or do I have to wait until the last "true" return for the function to exit?