✏️ Explanatory Question

What is the difference between auto variable and static variable in C?

👁 4,249 Views
📘 Detailed Answer
💡

Answer with Explanation

  • Both auto and static variables are local variables.
  • Static variables can retain the value of the variable between different function calls.
  • But, scope of auto variable is within the function only. It can’t retain the value of the variable between different function calls.