home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!math.fu-berlin.de!informatik.tu-muenchen.de!hphalle6!behrenss
- From: behrenss@Informatik.TU-Muenchen.DE (Soenke Behrens)
- Subject: Re: How do you connect all the records together?
- References: <lexier.714032180@sfu.ca>
- Sender: news@Informatik.TU-Muenchen.DE (USENET Newssystem)
- Organization: Technische Universitaet Muenchen, Germany
- Date: Mon, 17 Aug 1992 08:48:37 GMT
- Message-ID: <behrenss.714041317@hphalle6>
- Lines: 19
-
- From your post, it was less than clear exactly how your datastructures
- or your code looked like. Nonetheless, here goes:
-
- Have a pointer to your struct type, have a pointer to an array of pointers
- to your struct type. Now, everytime a record is to be inputed, malloc()
- memory for it, realloc() the memory in your array, store the pointer you
- got, input the struct. And so on.
-
- When you want to output them: Simply look at all the stored pointers.
-
- Easy enough. Really :) Write it down if you have trouble imagining it.
-
- Soenke
-
- --
- ===========================================================================
- More than silver, more than gold, I need ! behrenss@informatik.
- electricity. I need it for my dreams. ! tu-muenchen.de
- (RACTER) ! FIDO: 2:246/13 Soenke Behrens
-