Current area: HOME -> C / C++ -> Pointers Articles
Pointers
Callback Functions Tutorial
If you are reading this article, you probably wonder what callback functions are. This article explains what callback functions are, what are they good for, why you should use them, and so forth. However, before learning what callback functions are, you must be familiar with function pointers.
Clone Smart Pointer (clone_ptr)
The clone_ptr class is a smart pointer that can clone itself without requiring the base class to have a clone method. It can clone itself to the type pass to the constructor. The constructor for the clone_ptr is a template method, which is able to store type information for later usage when cloning the pointer.
Detail about How VPTR and Virtual table works
Assumption: 32-bit Machine.
Here I am going to explain How Virtual table, Virtual pointer for Virtual functions are internally working.
Smart Pointers - What, Why, Which?
Smart pointers are objects that look and feel like pointers, but are smarter. What does this mean? To look and feel like pointers, smart pointers need to have the same interface that pointers do: they need to support pointer operations like dereferencing (operator *) and indirection (operator ->).