Practice c++ code