首页 > 其他 > 详细

C编译错误:Main.c:4:5: error: variably modified ‘f’ at file scope int f[maxn];

时间:2020-04-04 12:49:45      阅读:82      评论:0      收藏:0      [点我收藏+]

错误范例:

  

#include<stdio.h>

const int maxn=10000+10;
int f[maxn];
int cnt;

 

错误原因:

C中const不是指常量,而是表示只读;const声明常量是在C++中的用法

C中声明一个固定长度数组,可用:

  

#define MAXN 256
int f[MAXN];

 

C编译错误:Main.c:4:5: error: variably modified ‘f’ at file scope int f[maxn];

原文:https://www.cnblogs.com/debug-the-heart/p/12631175.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!