Variable in C++
Variable is an identifier which holds data or another one variable is an identifier whose value can be changed at the execution time of program. Variable is an identifier which can be used to identify input data in a program.
Variable_name = value;
This is the process of allocating sufficient memory space for the data in term of variable.
If no input values are assigned by the user than system will gives a default value called garbage value.
Garbage value can be any value given by system and that is no way related to correct programs.
It is a disadvantage and it can overcome using variable initialization.
It is the process of allocating sufficient memory space with user defined values.
int b = 30;
It is a process of assigning a value to a variable.
int a= 20; int b;
b = 25; // --> direct assigned variable b = a; // --> assigned value in term of variable b = a+15; // --> assigned value as term of expression