Export (0) Print
Expand All

CSimpleArray::operator []

Retrieves an element from the array.

T& operator[]( 
   int nIndex  
);

nIndex

The element index.

Returns the element of the array referenced by nIndex.

// Create an array and display its contents
 CSimpleArray<int> iMySampleArray;

 for (int i = 0; i < 10; i++)
    iMySampleArray.Add(i);

 for (int i = 0; i < iMySampleArray.GetSize(); i++)
    _tprintf_s(_T("Array index %d contains %d\n"), i, iMySampleArray[i]);

Header: atlsimpcoll.h

Show:
© 2014 Microsoft