User:Teaser~enwikibooks/sandbox

This book is aimed at C programmers wanting to transfer their C skills to C++. The languages are similar of course, but C++ is not just simply "C with classes", it has features such as templates, containers and template metaprogramming that can be used to provide safe, efficient, practical and flexible code. The first step in converting a C programmer is to show them the benefit of C++'s encapsulation (classes) and references (avoid using pointers).

Example
Let's start with an example of typical C code.