In C, Is a static variable stored on the stack or the heap??

Posted by CVS26 on Stack Overflow See other posts from Stack Overflow or by CVS26
Published on 2010-04-18T07:56:03Z Indexed on 2010/04/18 8:03 UTC
Read the original article Hit count: 460

Filed under:
|
|
|
|

In C, Is a static variable stored on the stack or the heap??

I always thought that static vars are stored on the heap. (global lifetime)

I Got this doubt while answering the following Q:

http://stackoverflow.com/questions/2661369/storage-classes

Please clarify...

© Stack Overflow or respective owner

Related posts about stack

Related posts about heap