小编abh*_*nda的帖子

Shortcircuit Operator评估订单

main()
{
int a,b=0,c=1,d=1;
a=++b&&++c||++d;    
printf("%d %d %d",b,c,d);  //1 2 1
b=0,c=1,d=1;
a=b&&++c||++d;
printf("%d %d %d",b,c,d);  //0 1 2
}
Run Code Online (Sandbox Code Playgroud)

为什么第二个printf给出答案0 1 2而不是0 2 1?

c operator-precedence

-1
推荐指数
1
解决办法
61
查看次数

标签 统计

c ×1

operator-precedence ×1