Special Member Functions
C++ provides a special member function called the constructor which enables and object to initialized itself when it is created.
This is know as automatic initialization of objects.
It also provides another member function called the destructor that destroys the objects when they are no longer required.
Constructors and destructors are standard functions provided for a class.
The needs for these functions are C++ aims to use class objects similar to using standard types.
No comments:
Post a Comment