< Previous | Contents | Next >
When you instantiate objects, you often want to do some initialization—usually assigning values to data members. Luckily, a class has a special member function known as a constructor that is automatically called every time a new object is instantiated. This is a big convenience because you can use a constructor to perform an initialization of the new object.