Using a Pointer to Create a Call-by-Reference

C

chinmay.sahoo

Even though C++’s default parameter-passing convention is call-by-value, it is possible to manually create a call-by-reference by passing the address of an argument (i.e., a pointer to the argument) to a function. It will then be possible for code inside the function to change the value of the argument outside of the function. You saw an
example of this in the preceding chapter when the passing of pointers was discussed. As you know, pointers are passed to functions just like any other...

Read more

Continue reading...
 
Back
Top Bottom