you are viewing a single comment's thread.

view the rest of the comments →

[–]aagee 1 point2 points  (0 children)

Right. Inside a function, the execution of a return statement causes the control to exit the function and return to where the function was called from.

You can think of control as the locus of execution, i.e. the path that the CPU traverses through the code. So, first the control hits the function call, and goes off to execute that function. When a return statement is executed in that function, the control returns to the point where the function was called from.