Check out example codes for "c++ clas deconstructor". It will help you in understanding the concepts better.

Code Example 1

class Line {
   public:
      Line();   // This is the constructor declaration
      ~Line();  // This is the destructor: declaration
};

Learn ReactJs, React Native from akashmittal.com