A variable's lifetime is how long it exists. Local variables are created when the function starts and destroyed when it returns. Each call creates fresh variables. Locals don't remember values between calls.
Set int count = 0; and increment it, next call starts at 0 again. For persistence, use globals or statics. Globals live for the whole program. Created before main, destroyed after.
This makes them persistent but dangerous. Any function can change them.