From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID,XPRIO autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e433da2465aede0e X-Google-Attributes: gid103376,public From: Supreme Subject: Code Confusion. Date: 1997/11/02 Message-ID: <345CD154.1249E04E@eng.ua.edu>#1/1 X-Deja-AN: 287413046 X-Priority: 3 (Normal) Newsgroups: comp.lang.ada Date: 1997-11-02T00:00:00+00:00 List-Id: In the following program I am trying to display the values of linked list instead my output is 80 80 80 80 80 80 instead of 40 50 60 70 80. here it is. procedure problem is type LIST_NODE; type NODE_PTR is access LIST_NODE; type LIST_NODE is record NUM : INTEGER; NEXT : NODE_PTR; end record; HEAD,P : NODE_PTR; N, NUM_NODES : INTEGER; begin -- lab10A Put("Please enter the the values of the nodes"); Get( Num_Nodes); Head := new NODE; New_Line; P := Head; for K in 2..NUN_NODES loop Head.Next := P; P.ALL.NUM := N; P := P.Next; end loop; Will this allow teh user to assing 20 30 40 50 etc to the linked list? in other words Head.Next := P Should point the Head.next to the Pointer P and then P.ALL.NUM :=N should be set to the value of N ( entered by the user) then P := P.Next should allow N to be assigned to the next pointer. is this right?? Peace.