How the implementation of the struct in the D language to ubyte [] or ubyte [] to the struct, please brothers help answer this question, thank you!
If a struct contains the string or char [] what to do?
For example, such a structure:
struct UserLogin
{
align(1):
ushort ClientId;
int AccectId;
string LoginUid;
string LoginPwd;
}
Attention to my application in the socket!
To convert the raw data, the suggested idiom is like this:
This will not handle serialization of strings and pointers, though. You will need to do that manually or with a library.