Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualMrP

Posted 07 April 2013 - 09:41 PM

You're passing your Array object to the PrintArray function by value rather than by reference. As a result the parameter is a copy of the passed in argument (and therefore its m_array member points to the same address), so when the destructor is invoked at the end of the function the memory pointed to by both instances is deleted.


#1MrP

Posted 07 April 2013 - 09:40 PM

You're passing your Array object to the PrintArray function by value rather than by reference. As a result the parameter is a copy of the passed in argument (and therefore its m_array member points to the same memory), so when the destructor is invoked at the end of the function the memory pointed to by both instances is deleted.


PARTNERS