Jump to user comments
for performing a particular task. Most programming languages,
define subroutines. This allows the subroutine code to be
called from multiple places, even from within itself (in which
case it is called
recursive). The programming language
implementation takes care of returning control to (just after)
the calling location, usually with the support of call and
Most languages also allow
arguments to be passed to the
be passed back.
A
function is often very similar to a subroutine, the main
difference being that it is called chiefly for its return
(1996-10-01)