12.1 INTRODUCTION

In C, pointers were considered as a great strength of the language. Pointers allow certain (programming) tasks to be performed in limited memory space. However, over the years, the enthusiasm has subsided. For some computer scientists, the pendulum has swung to the other end. JAVA, the other Object–Oriented language, does not support pointers.

Pointers find use mainly under two categories. First when we want dynamic data structures, we have no alternative to pointers. This is the most fundamental use of pointers. In second case, when we want to allocate memory dynamically for variables or objects, we currently use pointers.

In this section, we will first introduce pointers in a general abstract way. At a later stage, we will ...

Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.