Feature 1631

Fixing of C-style API in C++ examples

If you have remarks, feel free to add them, so that more fixes could be integrated in this pull request.