CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 36

Threaded View

  1. #19
    Join Date
    Jul 2009
    Posts
    154

    Re: delete[] mechanics

    the number of elements is placed in a DWORD 4 bytes before the returned pointer...

    so if you would do this..
    Code:
    DWORD * array = new DWORD[5];
    then this is true:
    Code:
    array[-1] == 5
    this way it is know to the compiler how many elements are in the array, used only for the constructors and even more the destructors...



    note: this is not completely true.. see discussion below.
    Last edited by ProgrammerC++; July 13th, 2010 at 02:17 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured