Applied all fixes related to translating C to C++ code
Also fixed some typos and code alignment
Also adapted tutorial CPP samples
Fixed some identation problems
Merge pull request #1722 from StevenPuttemans:feature_1631_second