I have the following structure:
[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 symbols in the MarketSymbol field:
string symbol = "test";
Attributes.MarketSymbol = symbol.ToCharArray();
The compiler throws an error saying that it cannot convert from char [] to char *. How do I write this? Thanks
source
share