why stack contails garbage value and heap contains zero !!!!!!!!!!!!!!!!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lokesh yadav
    New Member
    • Nov 2006
    • 5

    why stack contails garbage value and heap contains zero !!!!!!!!!!!!!!!!

    hi i need explanation why stack contains garbage while we refer to stack default is any method to clean the stack my program exit so that my stack should contain zero as default ............... ............... .
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by lokesh yadav
    hi i need explanation why stack contains garbage while we refer to stack default is any method to clean the stack my program exit so that my stack should contain zero as default ............... ............... .
    You are not being very clear here. From the sound of your post only I will point out that if you declare a variable without initialising it, it will be given a garbage value. If you want the variable to default to zero, then initialise it zero.
    If you are going to explain the problem further, please do so with some code that you have written so others can understand better your problem.

    Comment

    Working...