C++ allows the programer to use either stack allocated memory or dynamic memory on the heap. I am fairly clear on how the stack operates (I have created stacks as exercises in C++) but am still curious about how and where "the stack" is defined.
Is "The Stack" a feature of the language, a feature of the OS or a feature of the hardware? I have a vague idea that each stack is something relating to each of the many active thread processes from the perspective of the operating system. This suggest to me that it's implemented on the software level and not a hardwired feature of the CPU or motherboard.
I imagine, in the case of a C++, the compiler might have inserted an implementation of a stack into each binary. Or maybe the OS applies it's own stack implementation into each running process? How and were is this defined?
I found a similar question here but I don't see it answered and my hope is to re-state the question more directly.