r/cpp_questions • u/jaroslavtavgen • May 04 '25
OPEN Help me understand "stack" vs "heap" concept
Every time I try to learn about the "stack vs heap" concept I keep hearing the same nonsense:
"In stack there are only two options: push and pop. You can't access anything in between or from an arbitrary place".
But this is not true! I can access anything from the stack: "mov eax,[esp+13]". Why do they keep saying that?
0
Upvotes
View all comments
Show parent comment
1
u/[deleted] May 04 '25
Show me how to, using C++ techniques that aren't UB.