Variables In Programming Languages

Definition

Variable is the name of memory in programming languages.

Explanation

Variable is a way of memory allocation to store the values. Variable is denoted as a memory name. Using variable, we can use the memory. We cannot see the memory directly. Memory is allocated while declaring a variable. We assume that after declaring a variable, the memory will be created. Each memory has a separate address using which we can find the memory. If we access memory values using address, it is faster. This type of accessing method is called Pointer in C Language.

We need to follow certain rules while creating a variable or variable name. Variable name should start with alphabets and not with the numeric letters. Each language has a limit of the length of a variable name. For example, in C language, the maximum variable name length is 32 characters. Each memory has a memory address. The system generates the memory address, automatically.

Example

int varFirstNo;

varFirstNo=10;

Diagram

Ebook Download
View all
Learn
View all