the.bay.news

Is there a way to see if some variable is stored on the stack or the heap?

programming.dev
Is there a way to see if some variable is stored on the stack or the heap?
I believe I have a good understanding of what is stored on the stack(for example primitive data types) and what’s stored on the heap(for example an instance of a class. But is there anyway to verify this for educational/verification of my expectations reasons? It can be in a debugger(gdb or rad debugger or worst case vs) or directly code based(thinking something like gettype(variable) but like isstackstored(variable).

0 comments

Sign in to join the discussion — your thebay.events account works here.

No comments yet.