Hello Ben,
Looking at the online help for BitConverter, I understand that it works for
data types such as int, double, etc. Is there a conversion method for the
whole struct at once or should I do one element at a time?
Thanks
EitanB
"Ben Voigt [C++ MVP]" wrote:
>
"Eitan" <Ei***@discussions.microsoft.comwrote in message
news:27**********************************@microsof t.com...
Hello,
I need to send a "struct" to an embeded CPU over the Ethernet.
The struct is defined like this:
[Serializable]
public struct MyStruct
{
public double dVar1;
public bool bVar2;
public int nVar3;
}
What would we the best way to pack it into an "array" and send it? Would
that be through Marshal.Copy!? or any other more effiecient way?
BitConverter and a byte[] the most straightforward.
Thanks
EitanB