Updated cpp.php
This commit is contained in:
@@ -359,11 +359,11 @@
|
||||
</ul>
|
||||
<li>Pass by reference</li>
|
||||
<ul>
|
||||
<li>The address of the variable is directly associated with the variables for the local scope. That is, these local scope variables now hve access to the variables outside of the scope. This is done by using the ampersand character: <code>void my_func(int &var) {...}</code>. Essentially, these new variables contain no new data and do not take up any more memory that was already there. No matter is created, only another name for a variable which is removed after the function completes execution.</li>
|
||||
<li>The address of the variable is directly associated with the variables for the local scope. That is, these local scope variables now hve access to the variables outside of the scope. This is done by using the ampersand character: <code>void my_func(int &var) {...}</code>. Essentially, these new variables contain no new data and do not take up any more memory that was already there. No matter is created, only another name for a variable which is removed after the function completes execution. The pass-by-reference parameters are called reference parameters and the arguments are called reference arguments.</li>
|
||||
</ul>
|
||||
<li>Constant parameters</li>
|
||||
<ul>
|
||||
<li></li>
|
||||
<li>Constant types of parameters contain the <code>const</code> type for the parameters. The constant parameter can be either pass-by-value or a pass-by-reference type as well.</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<h4>Pass by value:</h4>
|
||||
|
||||
Reference in New Issue
Block a user