Page 238 - DCAP404 _Object Oriented Programming
P. 238
Mandeep Kaur, Lovely Professional University Unit 11: Pointers and Dynamic Memory Management
Unit 11: Pointers and Dynamic Memory Management Notes
CONTENTS
Objectives
Introduction
11.1 Understanding Pointers
11.1.1 Pointer Variables
11.2 Declaring Pointers
11.2.1 Accessing Address of Variable
11.2.2 Pointer Expressions
11.2.3 Pointer Initialization
11.3 Pointer to Pointers
11.4 Pointer and Functions
11.4.1 Pointers to Functions
11.4.2 Function Returning Pointers
11.5 Dynamic Memory Management
11.5.1 New and Delete Operator
11.5.2 The this Pointer
11.6 Summary
11.7 Keywords
11.8 Review Questions
11.9 Further Readings
Objectives
After studying this unit, you will be able to:
Identify the understanding pointers
Demonstrate the accessing address of a variable
Recognize the declaring and initializing pointers
Describe the pointer to pointer
Explain the pointer to a function
Discuss the dynamic memory management
Introduction
Computers use their memory for storing instructions of the programs and the values of the
variables. Memory is a sequential collection of storage cells. Each cell has an address associated
with it. Whenever we declare a variable, the system allocates, somewhere in the memory, a
memory location and a unique address is assigned to this location.
LOVELY PROFESSIONAL UNIVERSITY 231