Array size in C [duplicate]
Possible Duplicate:
Non-const declaration of array
My compiler gcc allows
int n = 5;
int a[n];
Other compiler visual c gives error. It says array of size 0 cannot be created. Which compiler is correct?
Both are correct... these are compilers... In fact, std C assumes the size of a static array needs to be fixed and set by a constant value. use Define instead, or use malloc for dynamic arrays
精彩评论