Chapter 9 Flashcards
What is destructor
Destructor is used to free the memory that is allocated through dynamic memory allocation. It destroy object when it goes out of scope. Destructor name is same as class name with ~ as prefix
Destructors can not be overloaded. True of FALSE
True
How destructor called
In reverse order
What are accessor functions
Accessor functions are functions that are used to access data members that are defined in private.
What is ‘this’ pointer
It is pointer to object. So if there are 100 objects in memory of a program, when a specific object calls its function, compiler send a parameter automatically which tells which object is called.
Which variable is called this pointer
The variable that contains self-address is called this pointer.
What is the deceleration of this pointer
datatype * const this;