I have a class which have a static member. As I understand, all static members are common for all instances of the class, which means static members would be allocated memory only once. Where is this memory allocated (Stack or Heap) and when does this memory get allocated?
EDIT: This memory is different from a instance level memory. How does this memory get referenced? Does this memory get allocated at the time of compilation?