• Locally defined static variables keep their values between function calls
    • Useful to keep track especially in recursive functions
    • Be careful: this is not thread-safe
  • Globally defined static variables are accessible only within the scope of their program file
    • Good encapsulation measure Security and privacy of variables Static variables are stored in statically allocated memory reserved in data segment of program at compile time

Stack Overflow - What does static mean in C?