3 Replies - 1273 Views - Last Post: 24 June 2009 - 10:46 AM Rate Topic: -----

#1 vasanth barathi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-June 09

when to allocate memory in heap

Post icon  Posted 24 June 2009 - 06:28 AM

when to allocate memory in heap by using "new".
what will be advantage of allocating memory in heap rather than stack.
if a clear explanation is provided then the memory leaks would be arrested while programming itself
Is This A Good Question/Topic? 0
  • +

Replies To: when to allocate memory in heap

#2 Dantheman  Icon User is offline

  • D.I.C Regular

Reputation: 34
  • View blog
  • Posts: 445
  • Joined: 27-May 09

Re: when to allocate memory in heap

Posted 24 June 2009 - 08:38 AM

View Postvasanth barathi, on 24 Jun, 2009 - 05:28 AM, said:

when to allocate memory in heap by using "new".
what will be advantage of allocating memory in heap rather than stack.
if a clear explanation is provided then the memory leaks would be arrested while programming itself

We don't do homework here.
Was This Post Helpful? 0
  • +
  • -

#3 computerfox  Icon User is offline

  • straight vegetarian kid

Reputation: 50
  • View blog
  • Posts: 3,772
  • Joined: 29-January 09

Re: when to allocate memory in heap

Posted 24 June 2009 - 08:44 AM

View PostDantheman, on 24 Jun, 2009 - 07:38 AM, said:

View Postvasanth barathi, on 24 Jun, 2009 - 05:28 AM, said:

when to allocate memory in heap by using "new".
what will be advantage of allocating memory in heap rather than stack.
if a clear explanation is provided then the memory leaks would be arrested while programming itself

We don't do homework here.



looks more like a question on an exam to tell you the honest truth, but yeah, we can't do the work for you. you have to show us some effort so in that case i would have to say

void yourAnswer(){
while(0==0){
cout<<"So what seems to be the problem..."<<endl;
cout<<"We here at DIC don't do your work for you..."<<endl;
cout<<"We only help with code presented..."<<endl;
cout<<"Please edit your post with your code and specific question..."<<endl;
cout<<"Thank you..."<<endl;
}
}



[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#4 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2250
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: when to allocate memory in heap

Posted 24 June 2009 - 10:46 AM

To get these guys to answer your question you have to tell us what you think. No one will do your homework, but they will help you get it right.

Even if it is not homework doing a little google search and writing a few thoughts along with the questions will let people know that you are thinking on your own about the ideas.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1