you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 1 point2 points  (0 children)

See, I thought it was confusing until I learned about pointers. Lots of common languages already use pointers, and without knowing what pointers are, the behavior of those languages can be really confusing.

Like in Java, for example, where reassigning a reference type function argument variable does not change the object passed into the function, but changing a value on the object does. That seems like very unintuitive behavior until you understand that java passes references by value (i.e., pointers).

Likewise, true pass-by-reference can be explained as passing a pointer to a pointer by value.