I am a newbie to C++ and facing a problem.
I read in a book that memory is allotted to a static variable, once the object is created of that class. Now, what if I ma
Static variables are not at all stored in Heap.
Uninitialized static variables are stored in BSS segment.
Initialized static variable are stored in Data Segment.
You can read this article which explains all of it in a great way: http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory