System.PWideChar
Delphi
type PWideChar = ^Char;
C++
typedef WideChar* PWideChar; //
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
pointer typedef |
public | System.pas sysmac.h |
System | System |
Description
PWideChar is a pointer to a null-terminated string of WideChar values, that is, Unicode characters.
PWideChar defines a pointer to a memory location that contains WideChar values (including the #0 character).
In Delphi, one can obtain a PWideChar value from a string or a WideString, allowing seamless integration with C or C++ applications that expect null-terminated Unicode strings.
Notes:
- PWideChar is inherently unsafe if used in combination with normal string values. PWideChar variables are not reference-counted and are not copy-on-written. This may result in corruption of the string values or memory leaks.
- PWideChar is used by the Delphi desktop compilers, but is not supported by the Delphi mobile compilers. For more information, see Migrating Delphi Code to Mobile from Desktop.
Warning: Do not cast non-character pointer types to PWideChar to do pointer arithmetic. Instead, use the PByte pointer type, which is declared with the {$POINTERMATH ON} compiler directive.