Counter? I know about as much C as I know Quantum Mechanics, but I believe that this trick corresponds (roughly) to the static declaration, and is a common trick for this sort of problem. Rather than having a general term for the trick, using a term that also points to the variables purpose (like counter) is probably better self documentation. Just put a thorough knowledge of lexicals into your bag of tricks and call it whatever it needs to be called for that bit of code.
Light a man a fire, he's warm for a day. Catch a man on fire, and he's warm for the rest of his life. - Terry Pratchet