请教!逗号表达式!急!谢谢高手了
int a=0,b=0,c=0;
c=(a--=--5),(a=b,b+3); printf("%d",c);
答案是5?
为什么不是3?
2005-07-19 20:43
2005-07-19 20:45
我在VC下编译出现错误提示,不知道你用哪个编译器呢? 错误提示如下: Compiling... Cpp1.cpp E:\vcsyh\myfirst\Cpp1.cpp(5) : error C2105: '--' needs l-value E:\vcsyh\myfirst\Cpp1.cpp(5) : error C2106: '=' : left operand must be l-value Error executing cl.exe.
Cpp1.obj - 2 error(s), 0 warning(s)
2005-07-19 23:49
#include<stdio.h> void main() { int a=0,b=0,c=0,d=5; c=(a=(--d)--,(a=b,b+3)); printf("%d",c);
}
2005-07-20 00:00
#include<stdio.h> void main() { int a=0,b=0,c=0,d=5; c=(--a=--d,(a=b,b+3)); printf("%d",c);
}
2005-07-20 00:03
2005-07-20 18:17
2005-07-21 22:25
结果应该是5;
你的写法不太正确啊
2007-05-10 21:22
2007-05-10 21:25
2007-05-10 21:55