reference parameter notes

reference parameter notes - Void functions (functions that...

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

View Full Document Right Arrow Icon
Void functions (functions that do not return any value) Void functionName (list of parameters) Value returning function (function that returns some value, 1 and only value (one string, one bool, one int)) ret value functionName (list of parameters) value and reference parameters: value: original document, someone is interested in the information, photo copy the document and give the copy to the person and keep the original whatever is done to the copy does not affect the original reference : original document, someone is interested, instead of making a copy just give the document to the person, whatever change the person makes affects the original sharing a memory (both people can see the memory) How to indicate that a function has a reference parameter ? A reference variable is an alias for another variable o void getDimensions (int&, int&); changes to a reference variable are made to the variable it refers to use reference variables to implement passing parameters by reference
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/20/2011 for the course CSC 1253 taught by Professor Staff during the Fall '08 term at LSU.

Page1 / 3

reference parameter notes - Void functions (functions that...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online