C++ code