At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
In the context of C, the keyword "static" means that the value of a variable/pointer is saved from deletion in certain instances. Static arrays are a kind of static variable, and are set to null when declared (see http://stackoverflow.com/questions/553213/c-static-array).
Example of a static var inside a function:
By declaring a static variable (let's say it's an int and declared "int mystaticvar") inside a function, I can call the function multiple times and each time the value of mystaticvar would be whatever it was at the end of the previous call. Example:
-I call the function myFunc() and inside it the variable mystaticvar is declared to be 0. myFunc then sets the value of mystaticvar to 1. myFunc() returns, and all other non-static vars are eliminated.
-I call myFunc again, and now mystaticvar's value is 1 before I do anything with it!
Hope this helps!
but it says static.. i thought it means by constant.. so the value still change???
Not the answer you are looking for? Search for more explanations.
The true meaning/purpose of the keywords in C or C-like languages greatly differ from their English meaning :-D
Static in this case means that the variable retains definition and declaration even when it's scope is released. Calls can still be made to change the value of the variable. It isn't lost when the scope concludes.
Constant implies the value never changes.