for loop - statement with no effect

前端 未结 5 487
一整个雨季
一整个雨季 2021-01-28 06:36

For some reason I\'m getting an error: statement with no effect on this statement.

for (j = idx; j < iter; j + increment) {
    printf(\"from lo         


        
5条回答
  •  情深已故
    2021-01-28 07:09

    I think you meant j += increment, as j + increment doesn't actually alter j or indeed have any side effects at all - it is a statement with no effect, which is what the compiler is telling you

提交回复
热议问题