Answers for "error: 'for' loop initial declarations are only allowed in C99 or C11 mode"

C
3

error: 'for' loop initial declarations are only allowed in C99 or C11 mode

/*
This happens because declaring variables inside a for loop 
wasn't valid C until C99(which is the standard of C published in 1999), 
you can either declare your counter outside the for
or use the -std=c99 flag to tell the compiler explicitly 
that you're using this standard and it should interpret it as such.
*/
int j;
for(j=0;j<5;j++)
printf("%d",Arr[j]);
Posted by: Guest on September-01-2021

Code answers related to "error: 'for' loop initial declarations are only allowed in C99 or C11 mode"

Code answers related to "C"

Browse Popular Code Answers by Language