📜  错误:“for”循环初始声明只允许在 C99 或 C11 模式下使用 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:42.485000             🧑  作者: Mango

代码示例1
/*
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]);