title: When is memory allotted to static variables in C++
body: <p>I am a newbie to C++ and facing a problem.</p>
  
  <p>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 make this static variable global ? When would be it initialized in that case ?</p>
  
  <p>Plus, I have also read in some articles that static variables are allotted on heap and they dont rely on the construction of objects...is this true ? If yes, please explain the memory initialization steps to me, I need help.</p>
  
  <p>Thanks a lot !</p>