Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 25199 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > C# Interview Questions > Write the difference between Stack and H ...

Write the difference between Stack and Heap?

Interview question and answer by: Tripati_tutu | Posted on: 3/23/2011 | Category: C# Interview questions | Views: 2165 | | Points: 40


Answer:

Stack:
• Memory will be allocated at the compile time.
• Here the memory is allocated by the compiler.
• Memory will be allocated only in sequential locations.
• The memory will also be deleted by the compiler.
• There is lot of chance of memory wastage.

Heap:
• Memory will be allocated at the run time.
• Here the memory is allocated by the user.
• Memory will be allocated in sequential locations and non- sequential locations.
• The memory must be deleted explicitly by the user.
• There is no chance of memory wastage if the memory is handled perfectly.

Asked In: Many Interviews | Alert Moderator 
Found interesting? Add this to:


>> Write Response - Respond to this post and get points

Even more ... | Submit Interview Questions and win prizes!

More Interview Questions from Tripati_tutu

Even more ... | Submit Interview Questions and win prizes!


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/20/2013 11:35:29 AM