Static local variable

Mostly that is correct. It will keep whatever it’s value is across function calls, so if you assign to it after initialization that will be the value it has the next time the function is called (not sure if that’s what you were getting at with the wording of “last time this function was called” or not).

Personally, for something like that I would almost always declare it as const also.

1 Like