What is the difference between passing-by-reference and using the C pointer notation?
void some_function(some_type& param)
and
void some_function(some_type *param)
Thanks
What is the difference between passing-by-reference and using the C pointer notation?
void some_function(some_type& param)
and
void some_function(some_type *param)
Thanks
When you pass a pointer to a variable in a subroutine call, the address of that variable is passed to the subroutine. To access the variable in the subroutine, the pointer has to be dereferenced.
When you pass a reference to a variable, the compiler takes care of obtaining the address of the variable when the variable is passed to the subroutine and dereferencing the variable in the subroutine.
Basically you handle a safe pointer as if it was your own object.