正在加载图片...
Iterators(cont.) 圆 And how to use const int asize 8: int ia[ asize]={1,1,23,58,13,21} vector<int> ivec(ia, ia asize);//using the array to initialize the vector list<int> List(ia, ia asize); //using the array to initialize the list int * pa find (ia, ia asize, 1024) if (pa != ia asize) //found. vector<int>: :iterator it_v= find(ivec begin, ivec endo, 1024); if (it v!= ivecendo) / /found. list<int>: iterator it find (dlist, begin, ilist. endo, 1024) if (it_!= ilist. endo //foundIterators (cont.) ◼ And how to use const int asize = 8; int ia[asize] = { 1, 1, 2, 3, 5, 8, 13, 21}; vector<int> ivec(ia, ia + asize); //using the array to initialize the vector list<int> ilist(ia, ia + asize); //using the array to initialize the list int *pa = find(ia, ia + asize, 1024); if (pa != ia + asize) //found… vector<int>::iterator it_v = find(ivec.begin(), ivec.end(), 1024); if (it_v != ivec.end()) //found… list<int>::iterator it_l = find(ilist.begin(), ilist.end(), 1024); if (it_l != ilist.end()) //found…
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有