comp.lang.ada
 help / color / mirror / Atom feed
* Pointer types (I mean access types)
@ 2009-07-11  0:03 Rob Solomon
  2009-07-11  0:59 ` Adam Beneschan
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Rob Solomon @ 2009-07-11  0:03 UTC (permalink / raw)


I am trying to understand how pointers work in Ada.  I would like to
know if I have the correct equivalencies

Assume this declaration:
  type List_Node;  -- An incomplete type declaration.
  type List_Node_Access is access List_Node;
  type List_Node is
    record
      Data        : Integer;
      Next        : List_Node_Access;
    end record;

Ada                                               Modula-2 (or Pascal)
--------------------------------             ----------------------
type Node_Access is access Node; TYPE NodeAccess = POINTER TO Node;
Start : Node_Access;                      VAR Start : NodeAccess;
Current := new Node;                    Current := NEW(Node);
Current := Start;                            Current := Start;
Current.all := Start.all;                   Current^ := Start^;
Current.Data := 5;                         Current^.Data := 5;


I never learned C or derivatives.  So comparisons to C don't help me.

Thanks



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-07-12  9:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-11  0:03 Pointer types (I mean access types) Rob Solomon
2009-07-11  0:59 ` Adam Beneschan
2009-07-11  1:23 ` Randy Brukardt
2009-07-11  9:01   ` Hibou57 (Yannick Duchêne)
2009-07-11 19:41 ` anon
2009-07-12  9:03 ` Gautier write-only

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox