I am just making sure I understand this concept correctly. With the * operator, I make a new variable, which is allocated a place in memory. So as to not unnecessarily duplicate variables and their values, the & operator is used in passing values to methods and such and it actually points to the original instance of the variable, as opposed to making new copies…Is that right? It is obviously a shallow understanding, but I just want to make sure I am not getting them mixed up. Thanks!
Share
Not quite. You’re confusing a
*appearing in a type-name (used to define a variable), with the*operator.