C中的背对背分配

C中的背对背分配

This question already has answers here:
Closed 3 years ago.
C: transitive (double) assignments
(6个答案)
我今天遇到这个密码:
for (i = 0; i < level; i++) {
    a[i] = b[i] = c[i] = 0;
}

位于for循环内的代码的含义是什么?

最佳答案

 a[i] = b[i] = c[i] = 0;

解析为:
 a[i] = (b[i] = (c[i] = 0));

其效力与:
 a[i] = 0;
 b[i] = 0;
 c[i] = 0;

关于c - C中的背对背分配,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/39003181/

10-13 08:22