Condividi tramite


CArray::SetAtGrow

Imposta un elemento matrice all'indice specificato.

void SetAtGrow(
   INT_PTR nIndex,
   ARG_TYPE newElement 
);

Parametri

  • nIndex
    Un intero maggiore o uguale a 0.

  • ARG_TYPE
    Parametro di modello che specifica il tipo di elementi nella matrice.

  • newElement
    L'elemento da aggiungere a questa matrice.Un valore null è consentito.

Note

La matrice aumentano automaticamente se necessario ovvero il limite superiore viene regolato in base al nuovo elemento).

Esempio

// example for CArray::SetAtGrow
CArray<CPoint,CPoint> ptArray;

ptArray.Add(CPoint(10,20));   // Element 0
ptArray.Add(CPoint(30,40));   // Element 1
// Element 2 deliberately skipped
ptArray.SetAtGrow(3, CPoint(50,60));   // Element 3     

Requisiti

Header: afxtempl.h

Vedere anche

Riferimenti

Classe di CArray

Grafico della gerarchia

CArray::GetAt

CArray::SetAt

CArray::ElementAt

CArray::operator []