[Solved] increment in for loop of c++


Answering the literal question as stated…

The reason for the warning is simply because the left side of the comma in the for loop, third section, will have no effect. i+8 does not change anything, but rather returns a value.

Instead, you are wanting the compound assignment addition operator, += i+=8, which will add 8 to the current value of i. (See the Documentation)

for(U8 i=3;i<=31;i+=8,j++){

solved increment in for loop of c++