Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

Example

// 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]);

Requirements

Header: atlsimpcoll.h

Show: