Hi, I'm new to these forums!
I need help understanding "The Stack"
I understand its like a series of cubbyholes where 1 in is the first out
[]
[]
[]
[]
[]
but I don't understand whats the advantage of using the stack in c++ or why it was decided to be used, I don't get why you even need to understand it to code, any tips or questions to better understand it?
The first computers and hence assembler language took great advantage in using stacks because it makes quick access to programming steps and to local variables. Not just in C++, but C, VB, any language comes down to using stacks: The primary reason is that hardware is much easier to construct if it uses a stack.
Stacks are useful data structures as well. To be the best debugger, you need to embrace stacks IMHO.
That explains 'a stack', he is asking about knowing 'the stack'.
For general application level programming, you wouldn't really need to know much, but if you ever make a process that modifies another process, you would need to know it very well. It's usefull in debugging as well, because you will need to be able to understand it to be able to follow the flow of execution.