Linked List & Objects

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2005
Posts: 42
Reputation: TimC is an unknown quantity at this point 
Solved Threads: 0
TimC TimC is offline Offline
Light Poster

Linked List & Objects

 
0
  #1
Nov 27th, 2005
Are there any good tutorials out there that explain adding objects to a single linked list. All I have come across are linked lists involving "structs". regards T
Reply With Quote Quick reply to this message  
Join Date: Nov 2005
Posts: 78
Reputation: perniciosus is an unknown quantity at this point 
Solved Threads: 4
perniciosus's Avatar
perniciosus perniciosus is offline Offline
Junior Poster in Training

Re: Linked List & Objects

 
0
  #2
Nov 28th, 2005
Well as now one answered this ill just add the comment I had in mind when I first saw the post... in c++ structs are just classes with default access right of public, as opposed to private, so any code that can handle structs can handle objects...

however if this was a question about an object oriented solution to the linked list problem I guess that does not help much ? if you are new to c++ perhaps the list of the stl can be of intrest.
Originally Posted by Dinkum C++ on list
The template class describes an object that controls a varying-length sequence of elements of type Ty. The sequence is stored as a bidirectional linked list of elements, each containing a member of type Ty.
/pern.*/i

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. Albert Einstein
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,671
Reputation: Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all Lerner is a name known to all 
Solved Threads: 261
Lerner Lerner is offline Offline
Posting Virtuoso

Re: Linked List & Objects

 
0
  #3
Nov 28th, 2005
I find it useful to think of a list as a sequence of objects, frequently called links or nodes, linked by pointers. The link/nodes can be instances of a struct/class which in turn contain both a data object and at least one pointer. In C you can only use structs to do this, as the concept of class isn't available. In C++ a struct and a class are the same thing, except that struct members default to public access and class members default to public.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 598
Reputation: SpS is on a distinguished road 
Solved Threads: 32
SpS's Avatar
SpS SpS is offline Offline
Posting Pro

Re: Linked List & Objects

 
0
  #4
Nov 28th, 2005
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC