Destructors in dynamically allocated arrays

This is a discussion on Destructors in dynamically allocated arrays within the C++ Programming forums, part of the General Programming Boards category; If I have a dynamically allocated array of objects with destructors defined, and I use delete[] on the array, will ...

  1. #1
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552

    Destructors in dynamically allocated arrays

    If I have a dynamically allocated array of objects with destructors defined, and I use delete[] on the array, will all the destructors be called?

  2. #2
    Gronkulator of Surds littleweseth's Avatar
    Join Date
    Oct 2003
    Posts
    68
    yes, they will. make sure you include the square brakcets though , or memory leaks for all
    Ph33r the sphericalCUBE

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. swap dynamically allocated arrays
    By myle in forum C Programming
    Replies: 9
    Last Post: 05-18-2008, 09:04 AM
  2. Dynamically allocated size
    By maverickbu in forum C++ Programming
    Replies: 12
    Last Post: 06-26-2007, 01:16 PM
  3. 2D Dynamically allocated pointer arrays
    By Lionmane in forum C Programming
    Replies: 37
    Last Post: 06-11-2005, 10:39 PM
  4. Dynamically allocated arrays
    By axe786 in forum C Programming
    Replies: 6
    Last Post: 12-03-2004, 12:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21