Code Comments
Programming Forum and web based access to our favorite programming groups.Hi,
I am trying to send a struct via a UdpClient class. The Send method
expects a byte array, which a struct certainly is, but I am not sure
how to write the type cast operator.
public struct SomePacket
{
public int someData;
public static explicit operator byte[]( SomePacket packet )
{
???
}
}
I'm not even sure if this is possible, since a byte array is a
reference type, and a struct is a value type.
Thanks,
-Aleko
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.