Multiple conditions in a C 'for' loop

前端 未结 7 1946
一整个雨季
一整个雨季 2020-12-15 04:19

I came across this piece of code. I generally use \'&&\' or \'||\' to separate multiple conditions in a for loop, but this code uses commas to do that.<

相关标签:
7条回答
  • 2020-12-15 04:58

    There is an operator in C called the comma operator. It executes each expression in order and returns the value of the last statement. It's also a sequence point, meaning each expression is guaranteed to execute in completely and in order before the next expression in the series executes, similar to && or ||.

    0 讨论(0)
提交回复
热议问题