First I would like to know where you are declaring the static. Is in inside a function or a class member? But for some general explanation, when declared with static the variable becomes static and whose value is preserved through the program execution.