正在加载图片...
From pointers to iterators(cont,) u For array, common ways are using pointers and subscription template <typename ElemType> ElemType* find(const ElemType* array int iSize, const ElemType &value) if((! array)I size 1) return 0 for(int iX= O; iX iSize; iX++) if (array[] = Value) return &array; return OFFrom pointers to iterators (cont.) ◼ For array, common ways are using pointers and subscription template <typename ElemType> ElemType* find(const ElemType* array , int iSize, const ElemType &Value) { if ((! array) || size < 1) return 0; for (int iX = 0; iX < iSize; iX++) { if (array[iX] == Value) { return &array[iX]; } } return 0; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有