C++ Classes - Similarities Between Constructors and Destructors

Similarities Between Constructors and Destructors

  • Both have same name as the class in which they are declared.
  • If not declared by user both are available in a class by default but they now can only allocate and deallocate memory from the objects of a class when an object is declared or deleted.

Read more about this topic:  C++ Classes

Famous quotes containing the words similarities between and/or similarities:

    One internationally known twin researcher sees similarities between twins’ relationships and those of couple who have been married a long time. Fifteen-year-old twins, as well as spouses approaching their fortieth anniversary, each know their partners’ likes, dislikes, habits, and idiosyncracies as well as they know their own.
    Pamela Patrick Novotny (20th century)

    One internationally known twin researcher sees similarities between twins’ relationships and those of couple who have been married a long time. Fifteen-year-old twins, as well as spouses approaching their fortieth anniversary, each know their partners’ likes, dislikes, habits, and idiosyncracies as well as they know their own.
    Pamela Patrick Novotny (20th century)