cplusplus:pointers_2_slides
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
cplusplus:pointers_2_slides [2021/10/19 19:36] – [Calling functions by reference] mithat | cplusplus:pointers_2_slides [2021/10/19 19:40] – [Calling functions by reference] mithat | ||
---|---|---|---|
Line 64: | Line 64: | ||
* The '' | * The '' | ||
* 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 functionality is pass by reference. | ||
- | * The syntax | + | * Syntax |
===== Calling functions by reference ===== | ===== Calling functions by reference ===== | ||
Line 85: | Line 85: | ||
void cubeByReference(int *nPtr) | void cubeByReference(int *nPtr) | ||
{ | { | ||
+ | // *nptr'' | ||
*nPtr = (*nPtr) * (*nPtr) * (*nPtr); // parenthesis for readability | *nPtr = (*nPtr) * (*nPtr) * (*nPtr); // parenthesis for readability | ||
} | } |
cplusplus/pointers_2_slides.txt · Last modified: 2021/10/19 19:46 by mithat