Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: Why use new...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 23 Topic 44133 of 48417
Post > Topic >>

Re: Why use new?

by "Fred Zwarts" <F.Zwarts@[EMAIL PROTECTED] > Mar 27, 2008 at 09:47 AM

"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.
 




 23 Posts in Topic:
Why use new?
saneman <asdfsdf@[EMAI  2008-03-26 19:04:24 
Re: Why use new?
"Victor Bazarov"  2008-03-26 14:35:32 
Re: Why use new?
saneman <asdfsdf@[EMAI  2008-03-26 20:32:51 
Re: Why use new?
"Victor Bazarov"  2008-03-26 15:41:53 
Re: Why use new?
James Kanze <james.kan  2008-03-26 15:12:39 
Re: Why use new?
sean_in_raleigh@[EMAIL PR  2008-03-26 11:36:13 
Re: Why use new?
"jason.cipriani@[EMA  2008-03-26 12:33:03 
Re: Why use new?
James Kanze <james.kan  2008-03-26 15:10:05 
Re: Why use new?
Paul Brettschneider <p  2008-03-26 23:43:30 
Re: Why use new?
peter koch <peter.koch  2008-03-26 17:38:33 
Re: Why use new?
"Fred Zwarts" &  2008-03-27 09:47:21 
Re: Why use new?
James Kanze <james.kan  2008-03-27 02:45:58 
Re: Why use new?
Paul Brettschneider <p  2008-03-27 20:37:12 
Re: Why use new?
Ian Collins <ian-news@  2008-03-28 09:10:15 
Re: Why use new?
Paul Brettschneider <p  2008-03-27 21:59:20 
Re: Why use new?
Ian Collins <ian-news@  2008-03-28 10:15:11 
Re: Why use new?
James Kanze <james.kan  2008-03-27 02:50:30 
Re: Why use new?
James Kanze <james.kan  2008-03-28 01:31:59 
Re: Why use new?
Paul Brettschneider <p  2008-03-28 21:39:23 
Re: Why use new?
James Kanze <james.kan  2008-03-28 01:44:16 
Re: Why use new?
Ian Collins <ian-news@  2008-03-28 22:48:35 
Re: Why use new?
James Kanze <james.kan  2008-03-28 15:27:00 
Re: Why use new?
Andrey Tarasevich <and  2008-03-27 00:05:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 9:28:40 CST 2008.