I know what is the purpose of using static variables in an object oriented language, still, I don’t understand what is the meaning of using the “static” keyword in C.
Can someone explain it to me?
I know what is the purpose of using static variables in an object oriented
Share
On a function or global variable,
staticmakes the function or global variable local to that file; other files cannot access that function or global variable by that name (but they can access it if you give a pointer to it away).On a local variable, it makes it act as if it was a global variable, but is only accessible within that function (unless, again, you give a pointer to it away).