Compartilhar via


CHeapPtr::Reallocate

Chamar esse método para realocar a memória no heap.

bool Reallocate(
   size_t nElements 
) throw( );

Parâmetros

  • nElements
    o novo número de elementos usados para calcular a quantidade de memória para atribuir.

Valor de retorno

Retorna true se a memória foi atribuído com êxito, falso em caso de falha.

Exemplo

// Create a new CHeapPtr object
CHeapPtr <int> myHP;
// Allocate space for 10 integers on the heap
myHP.Allocate(10);
// Resize the allocated memory for 20 integers
myHP.Reallocate(20);   

Requisitos

Cabeçalho: atlalloc.h

Consulte também

Referência

Classe de CHeapPtr

CHeapPtr::Allocate