If you see, the syntax is,
for ( declaration expression1opt ; expression2opt ) statement
Let's compare it with a general statement
for (int i = 0; i < 10; i++) printf("%d \t", i);
Here,
int i = 0;
denotes declaration
[includes the ;
]
i < 10
denotes expression1opt
[optional]
;
is as per the syntax requirement of ;
[must, as described in syntax]
i++
is the expression2opt
[optional]
printf("%d \t", i);
is the statement
Now, in your case,
for (int i = 0, i; i++) { /* ... */ }
int i = 0, i;
denotes declaration
i++
denotes expression1opt
;
is missing .....
The last point here produces the error. You need to have the ;
to pass the syntax check.