home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / question / 13239 < prev    next >
Encoding:
Text File  |  1992-11-11  |  660 b   |  22 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!hela.iti.org!usc!rpi!cecchinr
  3. From: cecchinr@gehrig.cs.rpi.edu (Ron Cecchini)
  4. Subject: Proper way to read/write a struct from/to a socket
  5. Message-ID: <60p137_@rpi.edu>
  6. Nntp-Posting-Host: gehrig.cs.rpi.edu
  7. Organization: Rensselaer Polytechnic Institute, Troy, NY
  8. Date: Wed, 11 Nov 1992 17:39:55 GMT
  9. Lines: 11
  10.  
  11. Hi all,
  12.  
  13. o read()/write() expect you to read/write a "char *buf"
  14. o I have a variable "foo" which is of type "struct foo_type"
  15. o I've been reading/writing "(char *)&foo"
  16.  
  17. It seems to be working.  Am I just lucky, or is this correct?
  18. I've never tried reading into a structure like this before...
  19.  
  20. Ron
  21.  
  22.