System.WideStrUtils.WStrAlloc

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function WStrAlloc(Size: Cardinal): PWideChar;

C++

extern DELPHI_PACKAGE System::WideChar * __fastcall WStrAlloc(unsigned Size);

Properties

Type Visibility Source Unit Parent
function public
System.WideStrUtils.pas
System.WideStrUtils.hpp
System.WideStrUtils System.WideStrUtils

Description

Allocates a buffer for a PWideChar and returns a pointer to its first character.

WStrAlloc allocates a buffer for a PWideChar with a maximum length of Size - 1 (1 byte must be reserved for the termination character). The result points to the location where the first character of the string is to be stored. A 32-bit number giving the total amount of memory allocated is stored in the four bytes preceding the first character; it is equal to Size * 2 + 4. If space for a string is allocated with WStrAlloc, it should be deallocated via WStrDispose.

See Also