リストを構造体のフィールドとして定義するにはどうすればよいですか?
このようなもの :
public struct MyStruct
{
public decimal SomeDecimalValue;
public int SomeIntValue;
public List<string> SomeStringList = new List<string> // <<I Mean this one?
}
そして、その文字列を次のように使用します:
Private void UseMyStruct()
{
MyStruct S= new MyStruct();
s.Add("first string");
s.Add("second string");
}
私はいくつかのことを試しましたが、それらはすべてエラーを返し、機能しません。