Friday, July 29, 2016

C Basics - Summary of Storage Class in C

The storage class helps to economize the memory space consumed by the variables and improve the speed of execution of the program. The rules for usage of different storage classes are under:
  • Use static storage class only if you want the value of a variable to persist between different function calls.
  • Use register storage class for only those variables that are being used very often in a program.
  • Use extern storage class for only those variables that are being used by almost all the functions in the program.
  • If you don’t have any of the express needs mentioned above, then use the auto storage class.



Related topics:
Overview of Storage Class in C   |   Auto Storage Class in C   |   Register Storage Class in C   |   Static Storage Class in C   |   Extern Storage Class in C

List of topics: C Programming

No comments:

Post a Comment