TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Jari Laaksonen
from: Kurt Kuzba
date: 1998-09-01 02:55:48
subject: linked list to file

JL>   How do you save a linked list or doubly linked list to
JL>   file and read it from file?
   I am assuming that the list contains variable length elements
   and is not of a uniform size? This might happen when you
   include a string pointer as part of your list elements.
   You can save your strings separate, in the same order in
   which the list is saved, walking through the list and
   saving each element in one file, and the strings in another.
   When you load them back in, you create the list as you go,
   reading the strings into memory and pointing your list items
   to them. Or, you could save each list element, and follow it
   with the strings, and read it in in that fashion.
   You might also use a descriptor header, which defines the
   list elements, and then save each element, and then save
   the strings, resaving each element with file pointers to the
   strings replacing the char pointers previously used.
   This last method would be used in an application which has to
   read, write, and manipulate many diverse lists.

> ] You cannot enter the Underground without a Tolkien..........

---
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
SEEN-BY: 396/1 622/419 632/0 371 633/260 267 270 371 634/397 635/506 728 810
SEEN-BY: 639/252 670/213 218
@PATH: 154/750 222 396/1 633/260 635/506 728 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™.