If an lvalue appears in a situation in which the compiler expects an rvalue, the compiler converts the lvalue to an rvalue.
An lvalue e of a type T can be converted to an rvalue if T is not a function or array type. The type of e after conversion will be T.
can someone tell when compiler expects Rvalue .or what is exaclty rules such that an expression reducuing to Lvalue is Converted into Rvalue. in C when we try to declare variable size array
int b=8;
int a[2*b]; //compiler gives error that constant expression reqd. what is this constant expression (is it rvalue expression)
but when i do
int a[10];
a[2*b]=89;
it gives no error plz someone elaborate when Lvalue to Rvalue Conversion Happens?? my Confusion is that in array subscript in first case it Lvalue to Rvalue convesion not happens (at declaration time) but in second case it happens