home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.questions
- Path: sparky!uunet!hela.iti.org!usc!rpi!cecchinr
- From: cecchinr@gehrig.cs.rpi.edu (Ron Cecchini)
- Subject: Proper way to read/write a struct from/to a socket
- Message-ID: <60p137_@rpi.edu>
- Nntp-Posting-Host: gehrig.cs.rpi.edu
- Organization: Rensselaer Polytechnic Institute, Troy, NY
- Date: Wed, 11 Nov 1992 17:39:55 GMT
- Lines: 11
-
- Hi all,
-
- o read()/write() expect you to read/write a "char *buf"
- o I have a variable "foo" which is of type "struct foo_type"
- o I've been reading/writing "(char *)&foo"
-
- It seems to be working. Am I just lucky, or is this correct?
- I've never tried reading into a structure like this before...
-
- Ron
-
-