Name
PAnsiChar Type
Syntax
type PAnsiChar = ^AnsiChar;
Description
The PAnsiChar
type is a pointer to
AnsiChar and with Delphi’s extended syntax,
it can also be treated as an AnsiString or a
pointer to an array of AnsiChar.
Tips and Tricks
PAnsiCharis used most often as a parameter type for DLLs written in C or C++, such as the Windows API.You can treat a
PAnsiCharpointer as a pointer to an array ofAnsiChar. The array index is anIntegersubrange, starting from zero. Delphi does not provide any bounds checking for the array. The convention is that the end of the string is denoted by the presence of the#0character.Perform pointer arithmetic on a
PAnsiCharpointer by adding and subtracting integers similar to the way theIncandDecprocedures work.Delphi’s extended syntax is enabled by default. Use the
$Xor$ExtendedSyntaxcompiler directive to disable this feature and revert to behavior closer to standard Pascal.
See Also
| AnsiChar Type, AnsiString Type, Array Keyword, Char Type, PChar Type, String Keyword, PWideChar Type, $ExtendedSyntax Compiler Directive, $X Compiler Directive |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access