chapter4.cpp before smart pointer