Why don't we have rvalue of array type in C? -
i read statement in 1 discussion:
there no rvalues of array type in c. there pointer lvalues , rvalues, integer lvalues , rvalues, structure lvalues , rvalues etc... lvalue arrays. when try convert lvalue of array type rvalue, no longer have array, have pointer array's first member.
i unable when cannot change base address of array, how can use lvalue, how can it's name used on left hand side of assignment statement?
please explain briefly example.
the c11 standard draft n1570 footnote 64 says:
the name lvalue comes assignment expression
e1 = e2
, in left operande1
required (modifiable) lvalue. perhaps better considered representing object locator value. called rvalue in international standard described value of expression. obvious example of lvalue identifier of object. further example, ife
unary expression pointer object,*e
lvalue designates objecte
points.
so, name of array object locator value, object proper. however, in value context, name of array decays pointer first element.
if remember correctly, rvalues - is, values of expressions of type struct
s later (pre-ansish) addition language. done in backwards-compatible manner, structs wouldn't have decayed pointers, couldn't have worked arrays.
Comments
Post a Comment