mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 09:41:36 +00:00
Clarified function call by value description.
This commit is contained in:
parent
79fdd62c6b
commit
41f65bb341
@ -433,8 +433,12 @@ int getInt(char w) { //parameter name does not need to match function prototype
|
||||
}
|
||||
|
||||
/*
|
||||
Functions are pass-by-value, but you can make your own references
|
||||
with pointers so functions can mutate their values.
|
||||
Functions are call by value. So when a function is called, the arguments passed
|
||||
to the function are copies of original arguments (except arrays). Anything you
|
||||
do to your arguments do not change the value of the actual argument where the
|
||||
function was called.
|
||||
|
||||
You can use pointers if you need to edit the original argument values.
|
||||
|
||||
Example: in-place string reversal
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user