Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #11038

Re: Circular Link List program doesn't run

From Ike Naar <ike@sverige.freeshell.org>
Newsgroups comp.lang.c
Subject Re: Circular Link List program doesn't run
Date 2011-09-28 07:18 +0000
Organization A noiseless patient Spider
Message-ID <slrn3vfsj85iia.5l2.ike@sverige.freeshell.org> (permalink)
References <8ceb0f1f-92f5-4926-a66d-e6a726f09af8@t11g2000yqk.googlegroups.com> <741023e0-e416-45ef-891d-e6531808b90b@u6g2000vbo.googlegroups.com>

Show all headers | View raw


On 2011-09-27, Fred <fred.l.kleinschmidt@boeing.com> wrote:
> On Sep 27, 10:46?am, Maxx <grungeddd.m...@gmail.com> wrote:
>> [...]
> Your init() method is flawed. For each new node, you set l->next=l
> so the final node's "next" pointer points to itself, not to the first
> node.

It looks as if Maxx marks the end of the list with a node
that links to itself, instead of using the more customary convention
of letting the last node link to NULL.
Although his method is unconventional, it is not wrong in itself,
and I've seen situations where it works well.
One drawback is that the list cannot be empty; that is probably
the reason why Maxx initializes his list with a single element.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Circular Link List program doesn't run Maxx <grungeddd.maxx@gmail.com> - 2011-09-27 10:46 -0700
  Re: Circular Link List program doesn't run Fred <fred.l.kleinschmidt@boeing.com> - 2011-09-27 12:16 -0700
    Re: Circular Link List program doesn't run Ike Naar <ike@sverige.freeshell.org> - 2011-09-28 07:18 +0000
      Re: Circular Link List program doesn't run Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-28 11:03 +0100
      Re: Circular Link List program doesn't run James Kuyper <jameskuyper@verizon.net> - 2011-09-28 07:00 -0400
        Re: Circular Link List program doesn't run Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-10-03 20:10 +0300
      Re: Circular Link List program doesn't run Maxx <grungeddd.maxx@gmail.com> - 2011-09-28 10:54 -0700
        Re: Circular Link List program doesn't run James Kuyper <jameskuyper@verizon.net> - 2011-09-28 15:04 -0400
  Re: Circular Link List program doesn't run Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-09-27 20:21 +0100
    Re: Circular Link List program doesn't run Maxx <grungeddd.maxx@gmail.com> - 2011-09-28 10:53 -0700

csiph-web