Variables in embedded C language

What are variables in C language. Variables are simple keywords which are defined by the values. Values can be changed. Variables are like a boxes with some size where values like apples can be put in. So variables can be various forms and sizes so called variable types.

Variable type is defined by a reserved word which indicates the type and size of variable identifier:

unsigned char my_char;

long int all_my_numbers;

int number;

Why do we need variables? The basic answer is that memory is limited and compiler needs to know much space to reserve for each variable. So the programmer needs to specify the variable type and its size by using one of reserved words from the table:

Few statements demonstrating the usage of variables and value assignments:

int i; /* Define a global variable i */
i = 1; /* Assign i the value 0 */
{ /* Begin new block of sentences */
int i; /* Define a local variable i */
i = 2; /* Set its value to 2 */
} /* Close block */
/* Here i is again 1 from the outer block */