Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    cpp
  » The Rule Of Three
      by Valmont
 Page 1 of 17 
    Next >

(Login to remove green text ads)
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 fulfill some basic and fundamental 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.

There is a little catch.
One needs a very basic understanding of operator overloading: they both need each other to a certain extent. My advice is to learn the very basics of operator overloading first. In this tutorial we are going to overload the assignment operator. Therefore one needs a basic grasp of this technique first. Chapter One of the Operator Overloading tutorial is enough already. So please do read that first before moving on with this. However, if you are familiar with the very basics, then you're set most likely.

In short, these are the (main) prerequisites:
  • Basics of function overloading.
  • Very basics of operator overloading.
  • Basic handling of pointers.
  • Basic handling of references.
  • Basic (but confident) handling of dynamically allocated memory.
  • Understanding the this keyword.
  • Basic handling of functions that return by reference.
  • Basic handling of classes.
  • Confident with constructors.
  • Basic handling of the destructor.

Also, I am available for comments and communication in general on the forums, standard C/C++ section:
http://codenewbie.com/forum/forumdisplay.php?f=16
I really need some feedback otherwise I can't know if this material fulfills the needs of the student.

Good luck!




 
 Page 1 of 17 
    Next >

Rate This Article
1 2 3 4 5 6 7 8 9 10





Copyright © 2000-2006, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
Open Circle