编程知识 cdmana.com

C language questions, seek answers.

It is known that int x=0,y=5,z=8;printf(“%d”,(x++,++y,z=y++)); Why is the output 6?




Refer to the answer 1:

Comma expression , Returns the value of the last expression

(x++,++y,z=y++)x++=>x=1;++y=>y=6;z=y++; Equivalent to z=y;y++;



Refer to the answer 2:

版权声明
本文为[CSDN Q & A]所创,转载请带上原文链接,感谢
https://cdmana.com/2021/11/20211126094525025u.html

Scroll to Top