变长数组C99不是在C支持 [英] Variable length arrays C99 not supported in C

查看:175
本文介绍了变长数组C99不是在C支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2005中,我尝试编译.c文件:

In Visual Studio 2005, I'm trying to compile a .c file:

int i = 6;
int a[i];

这是不行的,所以它的标准我的编译器遵循?

It doesn't work, so which standard does my compiler follow?

推荐答案

Visual Studio中仅支持C89 / 90。他们有没有C99支持。因此,你不能在Visual Studio中使用变长数组。此外,微软还没有计划在他们的C编译器添加对C99的支持。

Visual Studio only supports C89/90. They have no support for C99. Therefore you cannot use variable-length arrays in Visual Studio. Furthermore, Microsoft has no plans to add support for C99 in their C compiler.

这篇关于变长数组C99不是在C支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆