int i = -5 , m,k=7;
m=2*(++i , k-=4);
printf("%d %d %d\n",i,m,k);
In this code the output is: [-4 6 3] but, I didn't quite understand where 6 comes from, can anyone help me?
k -= 4
"returns" 3.
The comma operator returns the second value which is 3
.
Then you multiply 2
by 3
.
m = 2 * (++i, k -= 4)
m = 2 * (-4, 3)
m = 2 * 3
m = 6