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)?
A static variable is a special variable that you can use in a function, and it saves the data between calls, and it does not delete it between calls. For example:
void func(){
static int count; // If you don't declare its value, the value automatically initializes to zero
printf("%d, ", count);
++count;
}
void main(){
while(true){
func();
}
}
The output:
0, 1, 2, 3, 4, 5, ...