Saturday, 29 April 2017

storage classes



Storage Classes in C

Storage classes are used to define scope and life time of a variable. There are four storage classes in C programming.
  • auto
  • extern
  • static
  • register
Storage Classes Storage Place Default Value Scope Life-time
auto RAM Garbage Value Local Within function
extern RAM Zero Global Till the end of main program, May be declared anywhere in the program
static RAM Zero Local Till the end of main program, Retains value between multiple functions call
register Register Garbage Value Local Within function




No comments:

Post a Comment

Please write your view and suggestion....