Lecture overview -- Keyboard shortcut: 'u'  Previous page: Functions and parameters -- Keyboard shortcut: 'p'  Next page: C Program organization -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 1 - Page 23 : 29
Notes about C++
From C to C++
Call-by-reference parameters via pointers

A call-by-reference parameter in C is a pointer passed as a call-by-value parameter

  • Motivation

    • Output parameters

    • Input parameters: Avoid copying large data structures

  • Examples

    • The struct functions discussed earlier

 

y:/Kurt/Files/Advanced-programming-cpp/c/by-ref-par/swap.cA C program with a swap function.


C++ offers a reference type that establishes an alias to an existing location in memory