1 / 4

Today’s Lecture

Today’s Lecture. Parameters Call-by-value Call-by-reference. Parameters. Two methods of passing arguments as parameters Call-by-value "copy" of value is passed Call-by-reference "address of" actual argument is passed. Call-By-Reference Parameters.

robert-ward
Download Presentation

Today’s Lecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Today’s Lecture • Parameters • Call-by-value • Call-by-reference

  2. Parameters • Two methods of passing arguments as parameters • Call-by-value • "copy" of value is passed • Call-by-reference • "address of" actual argument is passed

  3. Call-By-Reference Parameters • Used to provide access to caller’sactual argument • Caller’s data can be modified by called function! • Specified by ampersand, &, after type in formal parameter list

  4. Call-By-Reference Details • What’s really passed in? • A "reference" back to memory location of actual argument

More Related