mirror of
https://github.com/wangdoc/clang-tutorial.git
synced 2026-02-03 10:53:37 +08:00
docs(operator): fixed #90
This commit is contained in:
@@ -416,10 +416,11 @@ x = 10, y = 20;
|
||||
|
||||
```c
|
||||
int x;
|
||||
x = 1, 2, 3;
|
||||
|
||||
x = (1, 2, 3);
|
||||
```
|
||||
|
||||
上面示例中,逗号的优先级低于赋值运算符,所以先执行赋值运算,再执行逗号运算,变量`x`等于`1`。
|
||||
上面示例中,括号里面的逗号运算符,返回最后一个表达式的值,所以变量`x`等于`3`。
|
||||
|
||||
## 运算优先级
|
||||
|
||||
|
||||
Reference in New Issue
Block a user