Thats a principle of well written code, that functions only start at the top and only end at the bottom.
The idea is that:
Code:
int myfunc (int arg, double another) {
//Do stuff
int something;
switch (some_variable) {
case 1:
something = 6;
break;
case 2:
something = 9;
break;
}
return something;
}
Is good, whilst
Code:
int myfunc (int arg, double another) {
//Do stuff
switch (some_variable) {
case 1:
return 6;
break;
case 2:
return 9;
break;
}
}
Is not, because it exits in several places. As that switch statement gets more and more complex, it can be harder to think it though and find out what is happening in various situations. This can lead to spaghetti code.
As for entrances, it is very unusual that any modern code would use function with more than one entry point, but it would be a Bad Thing to try and do.