Hi
I have one basic query regarding how the system stores the Constants.
If i have the following code
As the comment suggest, the lvalue required fot the plain reference but not for the const double&. Is there any specific reason for this in the context of storage of normal variable v/s constants ? I am little confussed on this.
Thanks in advance.
sanjay
I have one basic query regarding how the system stores the Constants.
If i have the following code
Code:
double &dr = 1 ; // error: lvalue needed
constdouble &cdr = 1 ;
As the comment suggest, the lvalue required fot the plain reference but not for the const double&. Is there any specific reason for this in the context of storage of normal variable v/s constants ? I am little confussed on this.
Thanks in advance.
sanjay