Results 1 to 4 of 4

Thread: contents of stack and heap displayed in any window during runtime???

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    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), 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

  2. #2
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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++
    KrisSiegel.com - My Personal Website with my blog and portfolio
    Don't Forget to Rate Posts!

    Free Icons: FamFamFam, VBCorner, VBAccelerator
    Useful Links: System.Security.SecureString Managed DPAPI Overview Part 1 Managed DPAPI Overview Part 2 MSDN, MSDN2, Comparing the Timer Classes

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 2003
    Posts
    436

    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

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width