Variables in C has a storage class and a scope. The storage class identifies the part of memory where storage is allocated for an object/variable which is declared & defined.It defines how long the storage allocation continues to exist. It also determines the scope which specifies the part of the program over which a variable name is visible, i.e. the variable is accessible by name. There are four storage classes in C:
* automatic: Used with auto keyword in local scope.Initializes with garbage values if not defined.
* register: Used for frequently used variables.Initializes with zero if not defined.
* external: Used for global scope.Initialized with zero If not defined.
* static: Used for retaining the value during function calls.Initializes with garbage values if not defined.
* automatic: Used with auto keyword in local scope.Initializes with garbage values if not defined.
* register: Used for frequently used variables.Initializes with zero if not defined.
* external: Used for global scope.Initialized with zero If not defined.
* static: Used for retaining the value during function calls.Initializes with garbage values if not defined.
No comments:
Post a Comment