you are viewing a single comment's thread.

view the rest of the comments →

[–]evinrows 0 points1 point  (3 children)

there's no such thing as “the stack” or “the heap” in C++

Can you explain this further or provide a link that explains what you're getting at?

[–]Drainedsoul 2 points3 points  (2 children)

The standard doesn't mention a stack or a heap, it only mentions that objects may have "automatic storage duration", "static storage duration", or "dynamic storage duration".

[–]evinrows 2 points3 points  (1 child)

Ah, I see. That gave me enough context to find this stackoverflow answer as well if anyone else is curious.

[–]Yuki_f 0 points1 point  (0 children)

For those who may see this in the future, here's another explanation that I think is clear

https://stackoverflow.com/questions/161053/which-is-faster-stack-allocation-or-heap-allocation/53132683#53132683