Where are the static variable getting stored? Is it on heap .. or any other location?
Static Variable Storage
Collapse
X
-
Memory usage is implementation dependent and not part of the language. The stack and the heap are just imaginary places in memory. Both are dynamic.Originally posted by akila15Where are the static variable getting stored? Is it on heap .. or any other location?
Everything that's declared static is dumped in a fixed size block of memory. Static variables do not need to be stored in dynamic data structures because their size is completely determined before execution and remains the same.
Comment