Updated C++ example

* C++ example updated so it works with latest code