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不是编译期常量,不能当静态数组的长度啊
<2025年4月>
303112345
6789101112
13141516171819
20212223242526
27282930123
45678910

导航

统计

常用链接

留言簿

文章分类

文章档案

收藏夹

搜索

最新评论