IT. Expert System.

C

Local Variables


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 initalised by the system, you must initalise it yourself. When execution of the block starts the variable is available, and when the block ends the variable 'dies'.

Syntax:
return_type function_name(){

int a; //local variable

return value
}


Example:

main()
   {
      int i=4;
      int j=10;
   
      i++;
   
      if (j > 0)
      { 
         /* i defined in 'main' can be seen */
         printf("i is %d\n",i); 
      }
   
      if (j > 0)
      {
         /* 'i' is defined and so local to this block */
         int i=100; 
         printf("i is %d\n",i);      
      }/* 'i' (value 100) dies here */
   
      printf("i is %d\n",i); /* 'i' (value 5) is now visable.*/
   }
   
   This will generate following output
   i is 5
   i is 100
   i is 5


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 469 / 158779660. Delta: 0.02393 с