Parameter Passing

In Lisp, all parameters are passed to a subprogram by passing pointers to the values.

In other languages, there are two primary ways of passing parameters.

Call by value is the default for all values in Pascal and for small parameters (e.g. integers and floats) in C++. With this method, a copy of the value of the parameter is made and sent to the procedure that is called.

Call by reference passes the address of the value to the procedure.

In Pascal, the keyword var specifies call by reference.


   procedure sort( var arr: arraytype);

Contents    Page-10    Prev    Next    Page+10    Index