icp/oer/courses/c-basics/sections/03-functions/10-static/content.html

4 lines
389 B
HTML

<p>The static keyword enusres that a variable defined at toplevel is only visilbe in it's current c-file. Whereas normal variables can be accesed from other files using the extern keyword. The same applies for functions that are marked static.</p>
<p>When used in functions the static keyword just ensures that the value of the variable will be retained across calls of the function.</p>