In all the functions we have seen, the arguments passed to the functions have been passed by value. This means that when calling a function with parameters, what we have passed to the function were copies of their values however never the variables themselves. For instance, suppose that we called our first function addition using the following code:
int x=5, y=3, z;
z = addition ( x , y );
What we did in this case was to call to function addition passing the values of x and y, i.e. 5 and 3 respectively, but not the variables x and y themselves.
0 comments:
Post a Comment