use*_*316 12 c expression assignment-operator
在以下代码中:
int c;
while((c=10)>0)
Run Code Online (Sandbox Code Playgroud)
什么是c = 10评价什么?是1表示值10成功分配给变量c,还是10?为什么?
Bat*_*eba 14
c = 10是表达式返回10,其也将10分配给c.
据说在C99 6.5.16
An assignment operator stores a value in the object designated by the left operand. An
assignment expression has the value of the left operand after the assignment, but is not an
lvalue.
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6868 次 |
| 最近记录: |