Add a C++ code to test inheritance