www.openskytechnology.comDescription: Description: Description: Description: Description: Description: D:\website\syllabus\study_matreials\c++\logo_pic\logo.jpg

Training Home

Smart Pointer

  _______________________________________________________________________

 

Smart Pointer: A pointer which is smart. One such smartness is automatic deallocation of memory when the pointer no longer exists. One example of smart pointer is iterator of the Container class. Here an object is used to behave like a pointer and all the necessary operators(like *,++ etc.) are overloaded to provide such functionality.

 

In http://www.openskytechnology.com/c++/MyContainer.htm MyContainer class MyIterator class is designed as a smart pointer class. In main function MyIterator  object is defined which is a kind of smart pointer.

 

 

_______________________________________________________________________

 

 

Copyright © Open Sky Technology

 

Corporate Office:  #4, RR Complex, 2nd Floor, Munnekolala, Marathahalli, Bangalore – 560037. (Landmark: near Munnekolala Bus Stop)