Why we have-pointer and reference types?

… Obviously, we can refer to an object by name, but in C++ (most) objects ‘‘have identity.’’ That is, they reside at a specific address in memory, and an object can be accessed if you know its address and its type …

Bjarne Stroustrup 《The C++ Programming Language》(Fourth Edition),Chapter 7.

During our last discussion, @Lollipop9z(Invalid Link)raised this interesting question. Due to their background in learning Python programming language, they were puzzled about why features like pointers and references are provided in languages like C++. In fact, many students who have studied programming languages that include concepts of pointers and/or references still lack a thorough understanding of the reasons behind the existence of these language elements. The following code snippet illustrates this using C++ as an example.