"peter koch" <peter.koch.larsen@[EMAIL PROTECTED]
> wrote in message =
news:de59d3b7-a7b6-4ef2-9ea2-6da4127995ec@[EMAIL PROTECTED]
>On 26 Mar., 23:10, James Kanze <james.ka...@[EMAIL PROTECTED]
> wrote:
>>
>> (Actually, in the case of main, the memory will be deallocated
>> when you return from the function. Not immediately, but
>> returning from main means terminating the program, and on
>> program terminiation, the memory will all be deallocated. But
>> in general, the purpose of using new is precisely to ensure that
>> the object lives until you want to explicitly terminate its
>> lifetime.)
>
>When you return from main, there is not really much you can tell from
>a C++ point of view. At least, thats what I was told by some
>knowledgeable person in here some time ago ;-)
Well, you know that at least the static objects are deleted after return =
from main.
So, destructors may be called, etc.=20
For dynamically created object this is not defined.


|