In C , a variable declared as static is local to a particular function. It is initialised once and on leaving the function, the static variable retains the value. Next time when the function is called again, the static variable already has the value from the previous function call.
global and static variables are stored in DSS.In memory. A variable of static storage duration must beavailable throughout the lifetime of the program. The C standarddoesn't require any specific method of making this happen, and different compilers can do it differently
No comments:
Post a Comment