다음을 통해 공유


checked_array_iterator::checked_array_iterator

내부 반복기로 부터 기본 checked_array_iterator 혹은 checked_array _iterator 를 생성하세요.

checked_array_iterator( );
checked_array_iterator(
   ITerator ptr,
   size_t size,
   size_t index = 0
);

매개 변수

  • ptr
    A pointer to the array.

  • size
    배열의 크기입니다.

  • index
    (Optional) An element in the array, to initialize the iterator. By default, the iterator is initialized to the first element in the array.

설명

자세한 내용은 Checked Iterators을 참조하십시오.

예제

// checked_array_iterators_ctor.cpp
// compile with: /EHsc
#include <iterator>
#include <iostream> 

using namespace std;
using namespace stdext;

int main() {
   int a[] = {0, 1, 2, 3, 4};
   int b[5];
   copy(a, a + 5, checked_array_iterator<int*>(b,5));

   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << " ";
   cout << endl;

   checked_array_iterator<int*> checked_output_iterator(b,5);
   copy (a, a + 5, checked_output_iterator);
   for (int i = 0 ; i < 5 ; i++)
      cout << b[i] << " ";
   cout << endl;

   checked_array_iterator<int*> checked_output_iterator2(b,5,3);
   cout << *checked_output_iterator2 << endl;
}
  

요구 사항

헤더: <iterator>

네임스페이스: stdext

참고 항목

참조

checked_array_iterator 클래스

표준 템플릿 라이브러리