一般左值既可以在表达式的左边也可以在右边;
但是右值只能在表达式的右边;
例如:
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.