>To satisfy my curiosity, I've made the commitment to learn C++. The book I'm studying talks a lot about allocating memory on the stack and on the heap. While I understand the implications of doing such, the book never really says when it is more appropriate to use the stack or the heap. So, under what conditions should I use the stack and what conditions should I use the heap?
>
The stack is a local resource - it's scoped to the current process, and goes away automagically when you return from it. In general, the heap is not used for large or dynamically-allocated structures that need some persistence and it requires little attention to manage.
Heaps offer many advantages; a heap can be visible to all threads within a process, and can be made visible to other processes as well with a bit of work. Heaps require active management; a heap doesn't go away automagically, and in many cases a good deal of effort is needed to manage free space on the heap with several different possible management styles available.