Friday, August 21, 2015

C: static keyword

K&R: The static declaration, applied to an external variable or function, limits the scope of that object to the rest of the source file being compiled. 
-can be 'seen' within all functions in this source file
-can't be seen by linked objects used in this file.
-global variables
-if defined within a function f(), intialized during the first call of f(), after that, the static vars act like globals

No comments: