Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Pointers

  1. No pointer, no polymorphism.

  2. 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_ptr and weak_ptr. They are almost as efficient as raw pointers but much safer to use.

  3. If p is a dynamically allocated array, you have to use delete[] p to delete it when it is no longer required.

  4. auto_ptr objects cannot be stored in STL containers, because they are not copy-construable or assignable.