TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: Neil Heller
from: Darin McBride
date: 2003-01-23 21:33:54
subject: Declaring a pointer to a

Hello Neil!

Replying to a message of Neil Heller to Jasen Betts:

 JB>> AFAICT linked lists aren't really needed unless you're planning on
 JB>> inserting into them, or making individual deletions....

 NH> I've found that a linked list works great for passing information for 
 NH> which the number of items can't be known before-hand.

The one time I could choose any method of passing arguments I wanted, where
the sizes could not be known ahead of time, I used the Standard Template
Library.  Then I could pass references/pointers to vectors,
lists, etc., depending on what made the most sense for the way we
retrieved and used the data.

You get most of the speed benefits of an array with a vector, with most of
the flexibility of a linked list.  Of course, if you need all of the
flexibility of a linked list, or more speed while inserting in the middle
of the container, you can just swap "vector" with
"list", and you're done!

Darin
C_PLUSPLUS moderator
dmcbride{at}tower.to.org

---
* Origin: Tanktalus' Tower BBS (1:250/102)
SEEN-BY: 633/267 270
@PATH: 250/102 99 10/345 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.