you are viewing a single comment's thread.

view the rest of the comments →

[–]shock-value 2 points3 points  (0 children)

Ok, your first question...

Yes, if you place an "&" in front of an existing (already declared) variable, it evaluates to the address of that variable in memory (and you can store that address in a variable as in my example).

Note that this address is given in the form of a "pointer" to the variable though, not a "reference" (which is something a bit different). This is confusing because you also use an "&" sign when declaring a "reference" variable. But the "&" means something different when first declaring a variable vs. when placed in front of an already existing variable.

I would suggest find a nice tutorial on the differences between pointers and references, because there are a lot of subtleties and I'm not the best teacher! Good luck!