added sample c++ code