I have the following struct:
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
unsafe public struct Attributes
{
public OrderCommand Command { get; set; }
public int RefID { get; set; }
public fixed char MarketSymbol[30];
}
Now, I want to write characters to the field MarketSymbol:
string symbol = "test";
Attributes.MarketSymbol = symbol.ToCharArray();
The compiler throws an error, saying its unable to convert from char[] to char*. How do I have to write this? Thanks