quote:Original post by Paradigm Shifter
You do only have 1 copy of static locals, and C does support recursion.
I said 1 static copy, not 1 copy of a static. I may not have explained it very well, but if you understand there''s a big difference. In many languages that don''t support recursion (like old Fortran, not sure about more recent Fortrans) all local variables are static. As far as I can tell, there''s not really any other major reason to have a stack for local data other than recursion. Speed is not an issue here, as statics are just as fast as a stack. However, a stack is the most efficient storage when recursion is needed (that I can think of, my knowledge here is not bullet-proof).