Thursday, March 13, 2014


  1. #include <iostream>
  2. using namespace std;

  3. class Box
  4. {
  5.    public:
  6.       Box() { 
  7.          cout << "Constructor called!" <<endl; 
  8.       }
  9.       ~Box() { 
  10.          cout << "Destructor called!" <<endl; 
  11.       }
  12. };

  13. int main( )
  14. {
  15.    Box* myBoxArray = new Box[4];

  16.    delete [] myBoxArray; // Delete array

  17.    return 0;
  18. }