Where are static variables allocated in C++? On the stack or the heap?
Also, I read in 7.9 — The stack and the heap that all memory allocated on the stack is known at compile time. Is it true? Does it mean that only static memory allocation happens on the stack?
Also, please mention links, references to a a complete explanatory text about memory allocation in C++.
New contributor
Ibrahim Al-Etrebi is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.