我正在运行一个代码片段。但我无法理解它产生的代码和输出。
#include <stdio.h>
int main()
{
int a, b,c, d;
a=3;
b=5;
c=a,b;
d=(a,b);
printf("c = %d" ,c);
printf("\nd = %d" ,d);
return 0;
}
这个程序的输出是:
c=3
d=5
我不明白输出是怎么来的?
最佳答案
考虑 C 的逗号运算符的优先级。
关于c - 无法理解输出的原因,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10379381/