
Valmont has done it again, he has created the largest Code Newbie Article in existance. Below is a bit of the preface:
Preface
The Rule Of Three is an absolute must to understand for any C++ programmer. It deserves an own chapter, hence the tutorial. It covers the copy constructor, operator=() and the destructor as a combination to fullfill some basic and fundemantal requirements when it comes to building a class (or C++ struct) where members allocate memory in a dynamic way. We are going to setup the minimal basics of a String class to work with.
The neat thing about this tutorial is that it covers these three things in detail. Another plus is that this site supports multiple pages and images. So things are nicely grouped an made visible in vivid colors where needed. No chapter in a book in your local store will do that.
Actually, this tutorial is an excerpt from my tutorial on operator overloading. But the goal of the operator overloading tutorial is slightly different then the goal of this tutorial. This tutorial isn't much about general skill building. It intended for sheer concrete skill building. The “how” and “why” are well covered. But strictly within the framework of the Rule Of Three.
As opposed to the operator overloading tutorial, where a global skill building process is going on.
There is a little catch with this tutorial, and a “complete” operator overloading tutorial: they both need eachother to a certain extent. My advice is to learn the very basics of operator overloading first. Chapter 1 of operator overloading tutorial is enough already. However, if you are familiar with the very basics, then you're set most likely.
Read the Article Here