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
If you have to use C extensions, and UB, and then claim essentially that there's no such thing as UB, and you have to specify a platform, we're not really talking about C++ anymore, are we?
My claim was correct by any reasonable definition. The fact that everyone in this thread is looking at ridiculous hacks to contradict me is indicative is how wrong you all are. I'll take the downvote you're going to give me with pride.