int len=3;
cout<<sizeof(int [++len])<<endl;
//vs.net中编译通不过
//error C2540: non-constant expression as array bound

@二狗子_五哥
int len;
cin>>len;
int array[len];//这句就该报错了!len不是编译期常量,不能当静态数组的长度啊
<2024年8月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

导航

统计

常用链接

留言簿

文章分类

文章档案

收藏夹

搜索

最新评论