Monday, August 17, 2020

5.1 Introduction to C Variables

  • If you want to perform operations with any data, first you have to store it in memory of computer. 
  • Variables are used to store data in Computer memory.
  • A variable is the name of a location in the memory. 
  • This name (or variable) is used to uniquely identify that memory location in the entire memory of the computer and by this name you store the data in that memory location and retrieve that data. 
Introduction to C Variables


  • For example, this is the memory space of your computer. 
  • You want to store some data in computer memory. 
  • Such as the name of a person, age etc. Before you can store data in computer memory, you can tell what kind of data you store.
  • You define it by using data types. According to that, you get space in memory. That is, if you have defined int, 2 bytes variable will allot the compiler in memory.
  • After this you have to define the name of that memory location. So that whenever you want to access the memory stored in that memory location, you can access it by this name.
  • This name is called variable.
  • Values of variables are variable. You can delete a value and enter another value. You can also do this on compile time and dynamically (during program execution).





No comments:

Post a Comment

Please do not any spam link in Comment Box