saneha
05-02-2011, 06:27 PM
Example 1
int age; // variable set up
then later in the program
age = 39;
The value 39 is pulled or fetched (Rvalue) and stored into the variable named age (Lvalue); destroying the value previously stored in that variable.
Example 2
int age; // variable set up
int voting_age = 18; // variable set up with initialization
then later in the program
age = voting_age;
The value 18 is pulled or fetched from the variable named voting_age and stored into the variable named age is an example of r-value.
int age; // variable set up
then later in the program
age = 39;
The value 39 is pulled or fetched (Rvalue) and stored into the variable named age (Lvalue); destroying the value previously stored in that variable.
Example 2
int age; // variable set up
int voting_age = 18; // variable set up with initialization
then later in the program
age = voting_age;
The value 18 is pulled or fetched from the variable named voting_age and stored into the variable named age is an example of r-value.