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

C Programming Language >   Variable in C Language >   Storage Class in C  

Short Question

4432


Answer:

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


This Particular section is dedicated to Question & Answer only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.




Join Our telegram group to ask Questions

Click below button to join our groups.