STATIC VARIABLE IN C

  • Static variables are initialized only once.
  •  The compiler persists with the variable till the end of the program. 
  • Static variables can be defined inside or outside the function.
  •  They are local to the block.
  •  The default value of static variables is zero. 
  • The static variables are alive till the execution of the program.
  • Here is the syntax of static variables in C language:
   static datatype variable_name = value;
Posted on by