O'Reilly logo

Object-oriented Programming Using C++ and Java by Anand Vasappanavara, Gautam Vasappanavara, Ramesh Vasappanavara

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9

Pointers and References

LEARNING OBJECTIVES

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.

9.1 Introduction

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

  • Pointers are just like any other variables.
  • Pointers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required