Constructors
A constructor is a function that initilizes the members of an object. A constructor only knows how to build an object of its own class.Constructors aren't automatically inherited between base and derived classes. If you don't supply one in the derived class, a default will be provided but this may not do what you want.
If no constructor is supplied then a default one is created by the compiler without any parameters. There must always be a constructor, even if it is the default and empty. If you supply a constructor with parameters then a default will NOT be created.
Some points about constructors
- Constructors are just functions with the same name as the class.
- Constructors are intended to initialize the members of the class when an instance of that class is created.
- Constructors are not called directly (except through initializer lists)
- Constructors are never virtual.
- Multiple constructors for the same class can be defined. They must have different parameters to distinguish them.
On the next page : Don't forget destructors!

