Here is what the book says on page 205:
If you are familiar with operating system architecture, you might be interested to know that local variables and function arguments are stored on the stack, and global and static variables are stored on the heap.
This is definitely a mistake in the book. First, you should discuss storage in terms of storage duration, as the C ++ standard does: the “stack” refers to the duration of automatic storage, and the “heap” refers to the duration of dynamic storage. Both the “stack” and the “heap” are distribution strategies commonly used to implement objects with appropriate storage lengths.
Global variables have a static storage duration. They are stored in an area that is separate from the heap and stack. Global persistent objects are usually stored in the code segment, while volatile global objects are stored in the data segment.
source share