国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

C++的數(shù)組可以int n;cin>>n;int a[n];這樣初始化嗎?
天蓬老師
天蓬老師 2017-04-17 14:29:46
0
2
1261

如題,

 `int n;
  cin>>n;
  int a[n];

c++可不可以這樣初始化數(shù)組啊,在VS2010中不可以,在devc++(編譯器gcc) 中可以。

天蓬老師
天蓬老師

歡迎選擇我的課程,讓我們一起見證您的進(jìn)步~~

reply all(2)
Peter_Zhu

This is the variable length array VLA in the C language C99 standard, which is not supported by the C++ standard. The gcc compiler supports variable-length arrays, but the vc compiler does not. Search for variable length arrays. There will be a lot of information on this (in Chinese and English). Stroustrup, the father of C++, talked about variable-length arrays on his website. There is a short paragraph. If you are interested, you can check it out http://www.stroustrup.com/bs_...

小葫蘆

C++ does not support variable length arrays, C supports it

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template