How do I initialize a fixed byte array?
- by Jurily
I have the following struct:
[StructLayout(LayoutKind.Sequential, Pack = 1)]
struct cAuthLogonChallenge
{
byte cmd;
byte error;
fixed byte name[4];
public cAuthLogonChallenge()
{
cmd = 0x04;
error = 0x00;
name = ???
}
}
name is supposed to be a null-terminated ASCII string, and Visual Studio is…