Am 24.03.2023 um 15:04 schrieb Benito van der Zander via fpc-pascal:
why is a pointer to a char not a pchar (for type helpers)?
Because that's how helpers work in Delphi as well: The address operator
has as a result an expression that allows the use of a helper for the
raw Pointer type (no ma
On Fri, 24 Mar 2023, Peter B via fpc-pascal wrote:
On 24/03/2023 14:29, Martin Frb via fpc-pascal wrote:
On 24/03/2023 15:04, Benito van der Zander via fpc-pascal wrote:
why is a pointer to a char not a pchar (for type helpers)?
My guess: For the same reason that "p2" fails in the below.
On 24/03/2023 14:29, Martin Frb via fpc-pascal wrote:
On 24/03/2023 15:04, Benito van der Zander via fpc-pascal wrote:
why is a pointer to a char not a pchar (for type helpers)?
My guess: For the same reason that "p2" fails in the below. Distinct type.
May be assignment compatible, but a type
On 24/03/2023 15:04, Benito van der Zander via fpc-pascal wrote:
why is a pointer to a char not a pchar (for type helpers)?
My guess: For the same reason that "p2" fails in the below. Distinct type.
May be assignment compatible, but a type of it's own.
Imagine you had a different helper, with
Hallo,
why is a pointer to a char not a pchar (for type helpers)?
program Project1;
{$Mode objfpc}{$H+} {$ModeSwitch typehelpers}
type TPcharHelper = type helper for pchar
function toString(length: integer): string;
end;
function TPcharHelper.toString(length: integer): string;
begin
SetStr