您的位置:首页 > 其它

gcc Variable-length_array

2011-10-24 17:13 120 查看
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; 以示说明.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐