updated C++ snippets