1 / 4

Understanding Call-By-Value and Call-By-Reference Parameters in Today's Lecture

This lecture covers the two methods of passing arguments as parameters: Call-By-Value and Call-By-Reference. Learn how values and memory addresses are handled, allowing modification of caller's data. Explore the details of what is passed in these parameter types.

robert-ward
Télécharger la présentation

Understanding Call-By-Value and Call-By-Reference Parameters in 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