I have a structure in c# with two members:
public int commandID;
public string MsgData;
I need to turn both these into a single byte array which then gets sent to a C++ program that will unpack the bytes , it will grab the first `sizeof(int) bytes to get the commandID and then the rest of the MsgData will get used.
What is a good way to do this in c# ?
BinaryWritertogether withUtf8Encoding.