From 41f65bb3415e7002ef171c351376c1c4d5336746 Mon Sep 17 00:00:00 2001 From: Levi Bostian Date: Sat, 31 Aug 2013 17:04:47 -0500 Subject: Clarified function call by value description. --- c.html.markdown | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/c.html.markdown b/c.html.markdown index 75025b0c..e6e2559e 100644 --- a/c.html.markdown +++ b/c.html.markdown @@ -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 */ -- cgit v1.2.3