Dale - Computer Science Illuminated 280

Dale - Computer Science Illuminated 280 - 8.3 Functionality...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Value parameter A parameter that expects a copy of its argument to be passed by the calling unit (put on the message board) Reference parameter A parameter that expects the address of its argu- ment to be passed by the calling unit (put on the message board) 8.3 Functionality of Imperative Languages 253 Subprogram Declaration Language M–L8 P u–L *s7 S82gk‘V78 D92 ;. I912 20’ k‘V78 1TD ;. I912 20’ k‘N26 1z022 ;. u 9 82B hhh *9 u–L vD *s7 S82g 91 D92i { hhh } VB.NET C++/Java same. This is very helpful when a subprogram is called more than once, with different arguments in each call. Parameters passed in this fashion are often called positional parameters. Value and reference parameters There are two basic ways of passing parameters: by value and by reference (or address). If a parameter is a value parameter , the calling unit gives a copy of the argument to the subpro- gram. If a parameter is a reference parameter
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online