+ 1
Normally when you leave a function, the values in there are forgotten, so next time you call the function, it starts from zero. With static in front of a variable in a function, this value will be preserved. So when you call the function again, everything will start over, except your static variable: It will still contain the value from the last call.
8th Jan 2019, 7:52 PM
HonFu
HonFu - avatar