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 operand e1 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, if e unary expression pointer object, *e lvalue designates object e 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 structs later (pre-ansish) addition language. done in backwards-compatible manner, structs wouldn't have decayed pointers, couldn't have worked arrays.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -