亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標(biāo)題:
C++11 range based for似乎不能處理指針數(shù)組?
[打印本頁(yè)]
作者:
asker160
時(shí)間:
2016-06-08 15:52
標(biāo)題:
C++11 range based for似乎不能處理指針數(shù)組?
#include<iostream>
#include<iterator>
using namespace std;
int main()
{
//int buf[10];//OK!
int* buf=new int[10];
for(int& i:buf)
cout<<i;
return 0;
}
復(fù)制代碼
這段代碼,用gcc 的C++11編譯出錯(cuò),說(shuō)"begin" was not declared in this scope
很奇怪,用int buf[10]數(shù)組的時(shí)候編譯就沒有問題,buf變成指向數(shù)組的指針就編譯不過了。這是為什么?
歡迎光臨 Chinaunix (http://72891.cn/)
Powered by Discuz! X3.2