c++ pointer practice with classes