您的位置:首页 > 产品设计 > UI/UE

Lvalues and Rvalues in C#

2013-12-18 17:22 295 查看
一般左值既可以在表达式的左边也可以在右边;

但是右值只能在表达式的右边;

例如:

a = 10;   正确

a=b+10;正确

10 =11; 错误

英文解释如下:

There are two kinds of expressions in C#:

lvalue: An expression that is an lvalue may appear as either the left-hand or right-hand side of an assignment.

rvalue: An expression that is an rvalue may appear on the right- but not left-hand side of an assignment.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: