-
Hey quzah, I've been reading your post from the previous page about the return statement inside void functions. Well, what if you were to break out of a void function? Shouldn't the return statement be included in all function for the sake of consistency?
Code:
void something(int value1, int value2) {
if(value1 > value2) {
return;
}
std::cout << "The answer is : " << value1 + value2";
return;
}
Then again... I don't like using abort() or exit()...
-
You can return early from a void function. It isn't however a requirement. That was the question.
Quzah.