Pointers
-
No pointer, no polymorphism.
-
C/C++ is notorious for raw pointers. While pointers can boost up the speed of programs, it invites a trillion chances for making mistakes. You should avoid using raw pointers, instead, consider using
unique_ptr,shared_ptrandweak_ptr. They are almost as efficient as raw pointers but much safer to use. -
If
pis a dynamically allocated array, you have to usedelete[] pto delete it when it is no longer required. -
auto_ptrobjects cannot be stored in STL containers, because they are not copy-construable or assignable.