this is for exercise of c++ primer