From: "Kertis A. Henderson" Newsgroups: comp.os.msdos.djgpp Subject: Writing a struct to disk Date: Tue, 19 Aug 1997 02:00:39 -0400 Organization: Penn State University, Center for Academic Computing Lines: 23 Message-ID: <33F93687.14CE173@psu.edu> NNTP-Posting-Host: access-mkts1p15.mk.psu.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Under djgpp, what is the best way to write a bunch of structs to a file? For instance, I'd like to write a linked list to a file node by node, then be able to read the nodes back and reconstruct the list. A node could be something like the following: struct node { int number; unsigned char age; char *name; node *next; } The ints and chars would be relatively easy, but I don't see how a variable length string could be written. Of course, the node pointer wouldn't be written. If anybody could help me out (or possibly point me in the right direction), I'd appreciate it. Thanks for any input. -- Kertis Henderson kah190 AT psu DOT edu