By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,413 Members | 1,023 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,413 IT Pros & Developers. It's quick & easy.

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

P: 5
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 ...............................
Nov 8 '06 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
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.
Nov 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.