[CSI] Pass by Reference

Mikhail Nesterenko mikhail at cs.kent.edu
Sun Aug 15 17:00:23 EDT 2021


> 
> Passing by reference Allocates A Local Automatic pointer variable to
> the arguments memory location. When dealing with a dynamic member of
> an object, which is referenced by a pointer (this pointer being
> assigned to the local variable of the function), can this be thought
> of as a pointer to a pointer?
> 

actually, there is such a thing as a reference in C++. You could
declare a reference variable which is another name for the same memory
location.

  int i;
  int &j = i; // j is a reference to i
  j = 55;     // both j and i hold 55  

Thanks,
--
Mikhail


More information about the cs13001 mailing list