. Advertisement .
..3..
. Advertisement .
..4..
Does anyone know the cause of the error: ‘for’ loop initial declarations are only allowed in c99 mode? I’m really not good at programming and I don’t know where my command is wrong.
Help me! Please tell me the solution. I really appreciate everyone’s help. Thanks in advance.
The cause: The error: ‘for’ loop initial declarations are only allowed in c99 mode due to the fact that gcc’s for loop immediately initializes the variable
i
.Solution: The code must be modified. First, you must specify the variable
i
.Alternately, use C99 to declare the
i
variable in the for loop:gcc src.c -std=c99 -o src