In C you can have external static variables that are viewable every where in the file, while internal static variables are only visible in the function but is persistent
you can use it for counters and you won't pollute the global namespace.
you can protect variables using a function that gets the value as a pointer and returns the internal static. This whay you can control how the value is assigned. (use NULL when you just want to get the value)