The C++Course provides a general introduction to programming in C++. It is based on A.B. Downey's book, How to Think Like a Computer Scientist. Click here for details. |
![]() |
Home ![]() ![]() |
||
![]() ![]() ![]() ![]() ![]() ![]() |
||
Pass by Value
If printPoint happened to change one of the instance variables of p, it would have no effect on blank. Of course, there is no reason for printPoint to modify its parameter, so this isolation between the two functions is appropriate. This kind of parameter-passing is called "pass by value" because it is the value of the structure (or other type) that gets passed to the function.
|
||
Home ![]() ![]() |