0
Can any1 explain the use of static keyword?
2 Answers
0
sometimes we want a local variable NOT to be deleted. We need it for a further job.
To do this, use the static keyword when you first declare the variable:
0
declaring a variable static ensures that the variable retains whatever value it has after it is out of scope. This means that if u declare a static variable in a function and assigns some value to it when u recall the function the last value stored in the variable is still there it wont be reset to the initial value