chsvlib
chsv helper source code

◆ AllocateString()

CHAR_TYPE* Chusov::String::AllocateString ( std::size_t  cch)
noexcept

Allocates an uninitialized string of the specified size plus a room for the terminating zero.

Template Parameters
CHAR_TYPEis a type of a string to allocate. Currently the template is defined only for CHAR_TYPE=char and CHAR_TYPE=wchar_t resolving to AllocateStringA and AllocateStringW respectively.
Parameters
cchis a size of the string to be allocated excluding the terminating 0.
Returns
On success the function returns a pointer to the allocated wide string. On failure the function returns NULL. Use GetLastChsvError function to get extended error information. Use FreeString to free the allocated string.
See also
AllocateStringA;
AllocateStringW;
AllocateAndFormatString;
AllocateAndFormatStringByTags;
FreeString.