Completed exercises from the book C++ Pointers and Dynamic Memory Management