#include <stdio.h>
int main()
{
const int n= 10;
int arr[n]= {0};
return 0;
}
[Running] cd "d:\C++Projects" && gcc test1.c -o test1 && "d:\C++Projects"test1
test1.c: In function 'main':
test1.c:57:5: error: variable-sized object may not be initialized
int arr[n]= {0};
^~~
test1.c:57:18: warning: excess elements in array initializer
int arr[n]= {0};
^
test1.c:57:18: note: (near initialization for 'arr')
[Done] exited with code=1 in 0.07 seconds
为啥会是这样的情况呢,代码没写错啊