comp.lang.ada
 help / color / mirror / Atom feed
* Linked List in ada
@ 2002-06-18 23:21 kaak
  2002-06-19  0:50 ` tmoran
  2002-06-19  2:39 ` SteveD
  0 siblings, 2 replies; 9+ messages in thread
From: kaak @ 2002-06-18 23:21 UTC (permalink / raw)


I'm curious about linked lists and pointers in ada. I'm not sure exactly how
they work.

This is the code i have so far:

procedure insertRear(header:in out ptr; x: integer) is

        p: ptr;
        q: ptr;
BEGIN
        p = new node;
        p.key = x;
        q = header;

        loop:
                exit when q.next = null;
                if q.next then
                        q = q.next;
                else
                        exit;
                end if;
        end loop;

        q.next = p

I don't think the syntax is right with the pointers. and ideas?






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

end of thread, other threads:[~2002-06-20  6:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-18 23:21 Linked List in ada kaak
2002-06-19  0:50 ` tmoran
2002-06-19  5:54   ` kaak
2002-06-19  7:46     ` tmoran
2002-06-19 16:10       ` Mark Johnson
2002-06-20  1:58     ` SteveD
2002-06-20  6:50       ` Adrian Hoe
2002-06-19  2:39 ` SteveD
2002-06-19  5:53   ` kaak

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