Google News
logo
C-Language - Interview Questions
What is Local variables in C ?
Local variables scope is confined within the block or function where it is defined. Local variables must always be defined at the top of a block.

When a local variable is defined, it is not initialized by the system, you must initialize it yourself.

When execution of the block starts the variable is available, and when the block ends the variable 'dies'. It must be declared at the start of the block.

Example :

  void function1()
   {  
      int x=10; //local variable  
   } 
Advertisement