cplusplus:pointers_2
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
cplusplus:pointers_2 [2019/03/11 19:53] – [Pointer to constant data] mithat | cplusplus:pointers_2 [2019/03/28 16:55] (current) – mithat | ||
---|---|---|---|
Line 54: | Line 54: | ||
===== Calling functions by reference ===== | ===== Calling functions by reference ===== | ||
- | Pointers can be used to implement //call-by-reference// in functions. The '' | + | Pointers can be used to implement //passing |
<code cpp> | <code cpp> | ||
Line 63: | Line 63: | ||
</ | </ | ||
- | In the function above, '' | + | In the function above, '' |
<file cpp cube-by-reference.cpp> | <file cpp cube-by-reference.cpp> | ||
- | /** Cube a variable using call-by-reference with a pointer. */ | + | /** Cube a variable using pass by reference with a pointer. */ |
#include < | #include < | ||
using namespace std; | using namespace std; | ||
Line 89: | Line 89: | ||
<WRAP center tip 90%> | <WRAP center tip 90%> | ||
- | I feel pointers are much better than reference parameters for implementing | + | I feel pointers are much better than reference parameters for implementing |
</ | </ | ||
cplusplus/pointers_2.1552334008.txt.gz · Last modified: 2019/03/11 19:53 by mithat