warning icon  This site will be unavailable on Friday 21 February from 11:00AM to 5:00PM MST (1800 to 2400 UTC) for system maintenance.

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.