User Tools

Site Tools


cplusplus:pointers_2_slides

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
cplusplus:pointers_2_slides [2021/10/19 19:34] – [Calling functions by reference] mithatcplusplus:pointers_2_slides [2021/10/19 19:36] – [Calling functions by reference] mithat
Line 63: Line 63:
   * Pointers can be used to implement //pass by reference// in functions.   * Pointers can be used to implement //pass by reference// in functions.
   * The ''*'' operator is used to alias a variable inside of function.     * The ''*'' operator is used to alias a variable inside of function.  
-  * In the function below, ''*number'' is used as an alias for the variable passed in. +  * Strictly speaking, the passing mechanism is //call by value//. But functionality is pass by reference.
-  * Strictly speaking, the passing mechanism is //call by value//. But functionally it'pass by reference.+
   * The syntax in the function invocation (e.g., ''cubeByReference(&number))'' makes it clear that a pointer is involved --- which is good indication that call by reference is being used.   * The syntax in the function invocation (e.g., ''cubeByReference(&number))'' makes it clear that a pointer is involved --- which is good indication that call by reference is being used.
  
cplusplus/pointers_2_slides.txt · Last modified: 2021/10/19 19:46 by mithat

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki