{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Parameters - Parameters Dr David Gaitros LEARNING...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
Parameters Dr. David Gaitros
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
L EARNING O BJECTIVES Parameters Call-by-value Call-by-reference Mixed parameter-lists Overloading and Default Arguments Examples, Rules Testing and Debugging Functions assert Macro Stubs, Drivers 4-2
Background image of page 2
P ARAMETERS Two methods of passing arguments as parameters Call-by-value "copy" of value is passed Changing the copy does not affect the original Safest thing to do and should be the most common Call-by-reference "address of" actual argument is passed Change to the parameter changes to the original More difficult to do and more dangerous 4-3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
C ALL - BY -V ALUE P ARAMETERS Copy of actual argument passed Considered "local variable" inside function If modified, only "local copy" changes Function has no access to "actual argument" from caller This is the default method Used in all examples thus far 4-4
Background image of page 4