Sometimes you’ll need to pass an updated value of a variable back to the calling function and update the variable at the same time. A good example of this is in reading a number from the keyboard with the familiar scanf library function:
scanf ( "%d", &nNumber );
In this function call to scanf, the nNumber variable is passed by reference, (denoted by <type> and <name>). The reference in question is an actual pointer to the memory that contains the variable, and subsequently, the value can be modified.
This modification will hold outside the function, because you’ve allowed the function to access the place where it is stored. Of course, a constant value should not be passed by reference.
You can declare a function as containing ...