contents of stack and heap displayed in any window during runtime???
In the run mode, I can see the contents on stack in "locals" windows in VS.
it would be nice for beginners (to understand C# better), :blush: to be able to see the contents of both stack and heap.
that way we can understand when we instantiate an object of a class how the data is stored between stack and heap.
thanks
nath
Re: contents of stack and heap displayed in any window during runtime???
The heap isn't as easy to follow as the stack. The stack is just how it sounds, it stacks items on top of each other and then takes them off. Simple to follow.
The heap, well... there isn't any stacking and you're just putting items off into the heap space.
I don't think you can track that.
Also, don't forget .Net has it's own memory space seperate from unmanaged app's so you can forget about trying this for users of C/C++
Re: contents of stack and heap displayed in any window during runtime???
I agree with you.
but by knowing, where the data is stored (I mean stack or heap), the moment they are declared or initialized, a beginning c# programmer will be able to get better understanding of c#.
thats just my opinion..
thanks any way.
nath
Re: contents of stack and heap displayed in any window during runtime???
Why do you need to know where in the heap your objects are? As kasracer says, the heap is not structured like the stack is. It should be enough to know that an object is allocated on the heap. It's exact location is arbitrary so knowing it is of no real value. The only people who would benefit from such information would be the extremely advanced, not beginners.