home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / msdos / programm / 9060 < prev    next >
Encoding:
Internet Message Format  |  1992-09-07  |  1.0 KB

  1. Path: sparky!uunet!kithrup!hoptoad!decwrl!sdd.hp.com!caen!destroyer!gatech!usenet.ins.cwru.edu!icd.ab.com!iccgcc.decnet.ab.com!maslar
  2. From: maslar@iccgcc.decnet.ab.com (Mark Maslar x3095)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Read a structure from disk? 
  5. Message-ID: <1992Sep4.135012.8811@iccgcc.decnet.ab.com>
  6. Date: 4 Sep 92 13:50:12 EST
  7. Lines: 27
  8.  
  9.  
  10. Does anyone know of a simple way of reading an entire structure
  11. from a disk? I'd like to avoid having to read each element of the
  12. structure. Here's what I tried:
  13.  
  14. /* ************************************************************ */
  15. typedef struct
  16. {
  17.           char  name[33];       /* Company name */
  18.           char  addr1[33];      /* Company address 1 */
  19.           char  addr2[33];      /* Company address 2 */
  20. } address;
  21.  
  22. address  data;
  23.  
  24.  
  25.  
  26. fscanf(fp, "%address", &data);  /* This DOESN'T work. */
  27. /* ************************************************************ */
  28.  
  29. Please e-mail any ideas to Mark Maslar at:
  30.      maslar@icd.ab.com     (Internet)
  31.  
  32.  
  33. Thanks in advance,
  34.                    Mark Maslar
  35.  
  36.