I\'ve seen the word static
used in different places in C code; is this like a static function/class in C# (where the implementation is shared across objects)?
I hate to answer an old question, but I don't think anybody has mentioned how K&R explain it in section A4.1 of "The C Programming Language".
In short, the word static is used with two meanings:
static
keyword (big emphasis on it being used in
code as a keyword) is used with a declaration, it gives that object internal linkage so it can only be used within that translation unit. But if the keyword is used in a function, it changes the storage class of the object (the object would only be visible within that function anyway). The opposite of static is the extern
keyword, which gives an object external linkage.Peter Van Der Linden gives these two meanings in "Expert C Programming":