In languages like C, C++, C#, Java, and so on, void
is used as the return type of a function that only performs side effects and does not return any value:
void foobar() {
some_state++;
}
In such functions, it is illegal to use any form of return other than a no-value return:
void foobar() {
return; // okay