you could use unsafe code then cast it as you did earlier:
send( *((byte[]*)&packet)))
Yratelev
C# byte[] to struct packet
Below is a link to Chris Taylors blog that shows a few different ways, including thier pros and cons, of converting a byte to a struct and a struct to a byte.
http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/03/13/9017.aspx
Hope it helps,
synth0id
http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/03/13/9017.aspx
Hope it helps,
synth0id
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement