Article View: alt.comp.lang.learn.c-c++
Article #231Re: Please help me!!
From: Bud
Date: Tue, 03 Mar 1998 00:00
Date: Tue, 03 Mar 1998 00:00
26 lines
1251 bytes
1251 bytes
> Poor student studying for a scholarship exam in a week!!
>
> I want to know how (as simply as possible) to insert objects into a
> linked list.
>
if you have a node like:struct node
{
some data;
node* link;
};void list::insert(node* newNode){
node*
if(head) // if head ptr is not null
{
newNode->link = head;
head = newNode;
}
else
head = newNode
}
--
Bill's Place
http://www.ecst.csuchico.edu/~wfrench
Everything you wanted to know about nothing!
Technical Details
Message-ID:
<34FC6E46.7D09CC3A@inreach.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<34FC5E36.252831A1@tcd.ie>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,7edcd2b95cb2575c X-Google-Attributes: gid10d4ba,public X-Google-Thread: 109fba,7edcd2b95cb2575c X-Google-Attributes: gid109fba,public X-Google-Thread: 114592,7edcd2b95cb2575c X-Google-Attributes: gid114592,public From: Bud <bud@inreach.com> Subject: Re: Please help me!! Date: 1998/03/03 Message-ID: <34FC6E46.7D09CC3A@inreach.com> X-Deja-AN: 330519000 Content-Transfer-Encoding: 7bit References: <34FC5E36.252831A1@tcd.ie> To: Brian McSweeney <mcsweenb@tcd.ie> Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 NNTP-Posting-Date: Tue, 03 Mar 1998 12:50:40 PST Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++