The following code segment get an output of 32, I am kind of confusing why?
int i=(j=4,k=8,l=16,m=32); printf(“%d”, i);
Start reading inside the first set of parentheses.
The comma operator evaluates each of several expressions subsequently. It returns the return value of the last expression - in this case, it is 32, because the return value of an assignment is the value assigned.
http://en.wikipedia.org/wiki/Comma_operator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With