I have the following code line:
for ( int i = index; i < al->size; ++i )
//i,index and size are integers.al is an arraylist
When I compile this in C, I get the error:
'for' loop initial declarations are only allowed in C99 mode
Im not sure on how to fix this.
Thank you!
needs to become
Just declare
int i
before the loop.Try to declare the i variable first.
Either declare the iterator outside of the loop:
or if your compiler supports it, compile against the c99 or compatible standard:
(Note that gnu89/gnu90 is the default (as of 4.8, anyway.))