http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
105p 6.5.17 Comma operator
Semantics
2 The left operand of a comma operator is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value.
따라서 b=3이 실행된 후 sequence point를 거치게 되고, b+2는 5로 evaluated 됩니다. 따라서 a에 5가 대입되겠죠. 적법한 코드입니다.
http://www.open-std.org/jtc1/
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf
105p 6.5.17 Comma operator
Semantics
2 The left operand of a comma operator is evaluated as a void expression; there is a sequence point between its evaluation and that of the right operand. Then the right operand is evaluated; the result has its type and value.
따라서 b=3이 실행된 후 sequence point를 거치게 되고, b+2는 5로 evaluated 됩니다. 따라서 a에 5가 대입되겠죠. 적법한 코드입니다.
감사합니다! 좋은하루 되시길바랍니다
.
for 梦想
댓글 달기