代码改变世界

[整理]左值和右值

2014-07-04 06:43  Benoly  阅读(322)  评论(0编辑  收藏  举报
c99 6.3.2.1/1
An lvalue is an expression with an object type or an incomplete type other than void;
53) What is sometimes called "rvalue" is in this International Standard described as the "value of an expression".
An obvious example of an lvalue is an identifier of an object. As a further example, if E is a unary expression that is a pointer to an object, *E is an lvalue that designates the object to which E points.
-----
左值是对象类型的表达式, 而任意表达式都是右值.
比如一个对象的标识符是左值. 对于指向一个对象的指针表达式E, *E也是一个左值(结果是对象类型).