double [] via tcp/ip
-
Hi I was wondering if anyone has any idea how to solve the following (I am coming from a C background and trying to tackle this in C#). I have a TCP/IP client/server implemented. Everything that I have seen requires the data to be sent in a byte array (or as a single byte). I need to be able to send an Int32 (i.e. a 4-element byte array represenation of the integer) or a vector of double (or float) values. I haven't been able to find anything that will allow me to copy an integer/float into it's equivalent byte representation (for example the equivalent of memcpy in C). Any pointers would be greatly appreciated! Thanks Barry
-
Hi I was wondering if anyone has any idea how to solve the following (I am coming from a C background and trying to tackle this in C#). I have a TCP/IP client/server implemented. Everything that I have seen requires the data to be sent in a byte array (or as a single byte). I need to be able to send an Int32 (i.e. a 4-element byte array represenation of the integer) or a vector of double (or float) values. I haven't been able to find anything that will allow me to copy an integer/float into it's equivalent byte representation (for example the equivalent of memcpy in C). Any pointers would be greatly appreciated! Thanks Barry
See the
BitConverter
class in the .NET Framework SDK.Microsoft MVP, Visual C# My Articles