I am still a little fuzzy about static variables in C after reading some stuff:
according to this PDF file (bottom of 1st page) , a static variable is saved in the "initialised data" segment of my executable.
On the other hand, I quote my book* on C language:
On a system that allocates a relatively small run-time stack, one might wish to declare large arrays as
static
variables in functionmain
. Then these arrays will not use upstack
space.
Well from 1st link it does not look like as if a static variable (even an array) would ever use up stack space. So what is the deal?
*book is: "problem solving & program design in C", by Jeri R. Hanly & Elliot B. Koffman, 3rd edition