At the end of the chapter, you should be able to understand and use
Pointers and references, and know when to use what?
Objects and pointers.
Objects and references.
Dangling pointers and memory leaks.
Constant pointers, constant objects and references.
In our experience of teaching C++, we found that learners are pretty confused about pointers and references and related memory management. This is mainly because they would have probably picked up the “what” of pointers and references and not the “why” of pointers and references. In this chapter, we would like to bring out special characteristics of pointers and references like