I have created a code block, like this. 

```
proc()
{
    Z* z = new Z();
}

```

now the pointer declared inside method proc will have scope only till proc. I want to ask when the DTOR for z will be called automatically. whether when the controls come out of the method proc or when my application is closed.