C++ Primer学习笔记二
vector<int> a(10,0); for(vector<int>::iterator itor=a.begin();itor!=a.end();itor++) *itor=1; /* *itor can't changed */ for(vector<int>::const_iterator itor=a.begin();itor!=a.end();itor++) cout<<*itor; /* itor itself can't changed,but *itor is changeable */ const vector<int>::iterator itor; bool singal; cin>>singal;
计算数组长度
unsigned a[]={1,2,3,4,5,6,7,8,9,0}; cout<<sizeof(a)/sizeof(unsigned);
------------------------------------------
除非特别声明,文章均为原创,版权与博客园共有,转载请保留出处
BUY ME COFFEE