In fact, if you are learning C++, you better start it as a new language, rather than a tumor grown on the side of C. These languages are too idiomatically different.
In fact, if you are learning C++, you better start it as a new language, rather than a tumor grown on the side of C. These languages are too idiomatically different.
My strategy for writing in C++ is to write in C until I suddenly think "Hey, I should totally use an object here!"
http://www.boost.org/doc/libs/1_47_0/libs/smart_ptr/enable_s...
My C++ code is typically 3X shorter than corresponding C with fewer bugs and faster performance. The main issue is avoiding memory corruptions and getting away from pointers and memory leaks by leveraging the STL heavily.
I do use objects and make sure the members are C++ types rather than some C-style pointers, so that the copy and equality semantics are well defined. The key thing for me is avoiding pointers at all costs as pointers complicate memory management immensely. Use STL vector, set etc and in the worst case smart_ptr.