added c++ code.