|
|
楼主 |
发表于 2013-7-9 21:52:27
|
显示全部楼层
An object is a region of storage that can be examined and stored into. An lvalue is an expression that refers to such an object. An lvalue does not necessarily permit modification of the object it designates. For example, a const object is an lvalue that cannot be modified. The term modifiable lvalue is used to emphasize that the lvalue allows the designated object to be changed as well as examined. The following object types are lvalues, but not modifiable lvalues:
•An array type
•An incomplete type
•A const-qualified type
•An object is a structure or union type and one of its members has a const-qualified type
Because these lvalues are not modifiable, they cannot appear on the left side of an assignment statement.
一个对象(object)是一个能够被检查和存储数据的存储区域。一个左值就是与这种对象相关的一个表达式。一个左值并不一定是一个可以允许修改的指定的对象。例如:一个const的对象就是一个不可被修改的左值。可修改的左值这个术语是用来强调左值允许指定的对象在被检查的同时也可以被修改。下面的对象类型就是左值,并且是不可修改的左值:
1、一个数组类型
2、不完全的类型
3、一个被const修饰的类型
4、一个结构体或者联合中有被const修饰的类型的对象
因为这些左值都是不可被改变的,他们也不能出现在赋值语句的左边。 |
|