Variables - Devbhoomi

FREE JOB ALERT & ONLINE TUTORIALS

Hot

Post Top Ad

Sunday 5 November 2017

Variables

  • Variable in C Programming is called as container to store the data.
  • Variable name may have different data types to identify the type of value stored.
  • Suppose we declare variable of type integer then it can store only integer values.
  • Variable is considered as one of the building block of C Programming which is also called as identifier.
  • A Variable is a name given to the memory location where the actual data is stored.
Following are the types of variable in C :
  • Local Variables
  • Global Variables
Local Variables
  • Local Variable is Variable having Local Scope.
  • Local Variable is accessible only from function or block in which it is declared.
  • Local variable is given Higher Priority than the Global Variable.
Global Variables
  • Global Variable is Variable that is Globally available.
  • Scope of Global variable is throughout the program [ i.e in all functions including main() ]
  • Global variable is also visible inside function , provided that it should not be re-declared with same name inside function because "High Priority is given to Local Variable than Global"
  • Global variable can be accessed from any function.

No comments:

Post a Comment

Post Top Ad