C++ example updated