About Reference Parameter Subprogram Example B

In come cases, such as the Swap subprogram in Reference Parameter Example A, the use of reference parameters is essential. In other cases, use of reference parameters may not be essential, but may be prudent. The classic case is a situation in which very large arrays - hundred or even thousands of elements - are involved. In such situations, making copies of such arrays is to be avoided whenever possible. This demo illustrates some techniques that are applicable in such situations.

An existing array is to be filled with specific data. Making a copy of the array in question is not appropriate. The subprogram needs to operate directly on the array.

Things to note: Some things to discuss in this week's conference: