View Single Post
Old 16-03-2007, 13:15   #17
andbin
Senior Member
 
L'Avatar di andbin
 
Iscritto dal: Nov 2005
Città: TO
Messaggi: 5206
Quote:
Originariamente inviato da MEMon Guarda i messaggi
Si ma quello che non capisco è se la struttura che scrivo sulla pipe, quando poi dall'altra parte la vado a leggere come faccio a ricostruirla?
Cioè immagino che io leggo una serie di byte, come faccio a sapere che sono di una struttura, e come faccio quindi a riformarla?
MIASTRUCT s;
write (fd, &s, sizeof (s));


e poi

read (fd, &s, sizeof (s));

Dove fd può essere un qualunque descrittore. Il concetto è che stai scrivendo/leggendo un blocco di bytes.
__________________
Andrea, SCJP 5 (91%) - SCWCD 5 (94%)
andbin è offline   Rispondi citando il messaggio o parte di esso
 
Hardware Upgrade Forum Database Error
Database Error Database error
The Hardware Upgrade Forum database has encountered a problem.

Please try the following:
  • Load the page again by clicking the Refresh button in your web browser.
  • Open the www.hwupgrade.it home page, then try to open another page.
  • Click the Back button to try another link.
The www.hwupgrade.it forum technical staff have been notified of the error, though you may contact them if the problem persists.
 
We apologise for any inconvenience.