From: "Paul Lutus" Newsgroups: comp.lang.c++,comp.os.msdos.djgpp,comp.programming References: <3720BE52 DOT 6E86A8C4 AT xoommail DOT com> Subject: Re: Question: Linked lists and classes: Self initiation Lines: 28 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Message-ID: NNTP-Posting-Date: Fri, 23 Apr 1999 14:27:21 CDT Organization: Giganews.Com - Premium News Outsourcing X-Trace: sv1-lh6Aqf5p/tI22rJMMflXhvbpBpj2UwvbD+/OWB0GCTsntlY0lccOf+o0nA4Gl3q9xwZeA+nCJH1KFk2!xHvAGK3M21gu X-Complaints-To: abuse AT GigaNews DOT Com X-Abuse-Info: Please be sure to forward a copy of ALL headers X-Abuse-Info: Otherwise we will be unable to process your complaint properly Date: Fri, 23 Apr 1999 12:27:16 -0700 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Spell it "feasible." Yes, it is possible. But it is not a very good design. It is more of a stunt. -- Paul Lutus www.arachnoid.com Ishpeck wrote in message <3720BE52 DOT 6E86A8C4 AT xoommail DOT com>... >Is it fezible to have a linked list initiate itself recursively? I >think the best way to describe what I'm trying to say is put some >code up... > >class fooclass { > int number; > char character; > fooclass *next; > public: > void init(int setnum, char setchar, int quantity) { > number = setnum; > character = setchar; > if(quantity>0){ > next = new(fooclass); > next.init(setnum, setchar, quantity-1); > }//end if > }//end init method >};//end class