http://en.wikipedia.org/wiki/Variable-length_array
意味着gcc下,这么写是可以的:
#include <stdio.h>
int main() {
int buff_size = 1234;
char char_buff[buff_size];
printf("size:%d", sizeof(char_buff));
return 0;
}
VS2008下是不行的,
仍需要: const int buff_size = 1234; 以示说明.