That’s said, they differ only in the assignment semantics: “by reference” can replace the full contents, and “by sharing” instead rebinds the pointer to the new address. In fact, references in C++ are just a syntactic sugar for pointers. At the lower level they are even compiled to the same exact instructions, and hold the same values — that is, addresses. However, references change the high-level