C# byte[] to struct packet

Started by
11 comments, last by Trashcann 20 years ago
you could use unsafe code then cast it as you did earlier:

send( *((byte[]*)&packet)))



Yratelev

Yratelev
Advertisement
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

There is no point in doing anything at all, you'll die pretty soon anyway.
Thanks guys, I got it working using a few casts on the individual members.
ermokwww.truevision3d.com

This topic is closed to new replies.

Advertisement