0

I ran a snippet of C++ code in Microsoft Visual Studio and am tryomg to understand the export of Memory Dump.

The code is the following

Dummy* pA;
{
    Dummy* pB = new Dummy("Kostas");
    pA = pB;
}

delete pA;
pA = NULL;

When the line delete pA is executed, I see that the bytes where the pA shows are filled with 0xdd.

Does hex dd have any special meaning? enter image description here

user438383
  • 5,716
  • 8
  • 28
  • 43
KostasA
  • 5,204
  • 6
  • 23
  • 29
  • 2
    As described in document linked [here](https://stackoverflow.com/a/127404/7034621) [0xDD is magic number for `free()`'d memory](https://en.wikipedia.org/wiki/Magic_number_(programming)#Debug_values) – orhtej2 Nov 26 '21 at 10:53
  • Also, this only happens in DEBUG builds. – orhtej2 Nov 26 '21 at 10:54

0 Answers0