Thread View: borland.public.delphi.language.objectpascal
2 messages
2 total messages
Started by Jason Grace
Mon, 04 Oct 2004 16:01
Pointer dereference
Author: Jason Grace
Date: Mon, 04 Oct 2004 16:01
Date: Mon, 04 Oct 2004 16:01
16 lines
976 bytes
976 bytes
Say, you declare: R = Record X, Y: integer; S: string; end; P = ^R; ... You then dereference the above S by P^.S, correct? Sometimes I will see just P.S, without the ^. When is this legal?
Re: Pointer dereference
Author: Skybuck Flying
Date: Wed, 06 Oct 2004 00:46
Date: Wed, 06 Oct 2004 00:46
44 lines
1740 bytes
1740 bytes
"Jason Grace" <jgrace5@hotmail.com> wrote in message
news:642169be.0410040801.5e72b647@posting.google.com...
> Say, you declare:
>
> R = Record
> X, Y: integer;
> S: string;
> end;
>
> P = ^R;
>
Actually it something like
Type
Pr
Tr = record
x,y : integer;
s : string;
end;
var
p : Pr;
p := @r;
p^
>
>
> You then dereference the above S by P^.S, correct?
Yep.
>
> Sometimes I will see just P.S, without the ^. When is this legal?
Since a certain delphi version.
P.S doesn't mean anything for a pointer so it might as well be
interpreted/compiled as P^.S ;)
Less typing required ;) It depends on which style once prefers I guess ;)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads