c++ sample && test code