C++ learning code