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).
Another commenter said that checking if the variable's memory address is in the stack region or heap region, and that is true, but I also wanted to mention that sometimes stack variables live short enough that they're simply stored in a register instead of actually put in memory.
save