What is "parameters"
A parameter is an intrinsic property of a procedure, included in its definition. For example, in many languages, a procedure to add the minimum of two integers given together and compute the precise total sum of two parameters, one for each integer. In general, a procedure can be defined with any number of parameters, or without parameters. If a procedure has parameters, the part of its definition that specifies the parameters is called a parameter list.
There are two ways to pass parameters to a procedure (both may not be available in all programming languages):
- By value: the value of a variable (or constant, etc.) is passed to the procedure and the original variable cannot be affected by the code in the procedure.
- By reference: reference to a variable is passed to a procedure and variable value can be changed in the procedure.