Variable Scope and Lifetime

Last modified by Microchip on 2023/11/09 09:06

  • 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.