嗨,只是想知道您是否在 if 条件中使用链式分配,最左边的变量是否用于检查 if 条件
像 a=b=c 一样,它的 a 是最终检查的,而不是 b 或 c
#include <stdio.h>
int main()
{
int a, b, c =0;
// does this reduce to a == 100 and the variables b or c are not checked if they are == to 100 but simply assigned the value of 100 ?
if( (a = b = c = 100) == 100)
printf( "a is 100 \n");
return 0;
}