Storage Class

Storage class is modifier or qualifier of data type. it will decide

  • In which area of memory a variable will be stored.
  • Scope of the variable.
  • visibility/availability of variable.

Memory Section

In which memory area variable will get memory.

Variable Scope

Scope of variable means whether variable is avalible or not avalible for any operation within a boundry.

There are 4 diffrent types of scope

  1. Block Scope: Area between curly bracket.
  2. Function Scope: Function scope means function definition area.
  3. File Scope: File Area
  4. Program Scope: Whole program.

Variable Visibility

Visiblity of an variable means Accessibility of variable. upto which part or area of a program, we can access a variable.

Types of Storage Class

There are 4 types of storage class in c

  1. auto
  2. register
  3. static
  4. extern

Scope and Visiblity of storage class

Storage ClassDeclearationScopeVisibility
autoGlobal
Local
BlockBlock
registerGlobal
Local
BlockBlock
staticGlobal
Local
ProgramFile
Block
externGlobal
Local
ProgramProgram
Block




©2023-2024 rculock.com