Hacker News new | past | comments | ask | show | jobs | submit login

As far as I know, using `new` or not has nothing to really do if it goes onto the stack or not. That's simply a common implementation details.

What its really saying is if the lifetime is automatic or manual.

Maybe I'm confusing C with C++ or just outright confused, but to my understanding, nothing says that:

    int foo[] = <massive amount of data>;
actually has to live on the stack.



Well, in practice, it's both. Sure, stacks and heaps are an implementation detail, but they're pervasive. You simply can't write int x[10000][10000]; and expect it to not cause a stack overflow in any real world implementation. It's an implementation detail you absolutely need to be aware of.


> nothing says that [...] actually has to live on the stack.

This might be possible in theory but I've never seen it in practice.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: