Partager via


CSimpleStringT::Preallocate

Allocates a specific amount of bytes for the CSimpleStringT object.

void Preallocate(
   int nLength
);

Parameters

  • nLength
    The exact size of the CSimpleStringT character buffer in characters.

Remarks

Call this method to allocate a specific buffer size for the CSimpleStringT object.

Example

The following example demonstrates the use of CSimpleStringT::Preallocate.

CSimpleString str(pMgr);

_tprintf_s(_T("Allocated length: %d\n"), str.GetAllocLength());
str.Preallocate(100);
_tprintf_s(_T("Allocated length: %d\n"), str.GetAllocLength());

Requirements

Header: atlsimpstr.h

See Also

Concepts

CSimpleStringT Class

CSimpleStringT Members