Question: when is memory allocated for static variable in c++
Answer: In general , static memory allocation is the allocation of memory at compile time , before the associated program is executed , unlike dynamic memory allocation or automatic memory allocation where memory is allocated as required at run time .