updated the C++ sample