U
user
Hello
I have structure:
public struct buf
{
public int type;
public int len;
public byte [] data;
};
and in my program:
String d="something";
send_buf.data=Encoding.ASCII.GetBytes(d);
and after that i want to send whole struct throught my socket function:
System.Net.Sockets.Socket.Send().
How can i convert my buf structure to byte [] ?
I need to be assured that for example:
field type (int) will be 32 bits (even when type will use only first few
bits), and so on...
How can i do it?
I have structure:
public struct buf
{
public int type;
public int len;
public byte [] data;
};
and in my program:
String d="something";
send_buf.data=Encoding.ASCII.GetBytes(d);
and after that i want to send whole struct throught my socket function:
System.Net.Sockets.Socket.Send().
How can i convert my buf structure to byte [] ?
I need to be assured that for example:
field type (int) will be 32 bits (even when type will use only first few
bits), and so on...
How can i do it?