Variable Scope and Lifetime

Last modified by Microchip on 2025/08/26 05:27

  • The scope and lifetime of a variable depend on its storage class:
    • Automatic Variables
    • Static Variables
    • External Variables
    • Register Variables
  • Scope refers to where in a program a variable may be accessed.
  • Lifetime refers to how long a variable will exist or retain its value.