リストの金額を変更したいのですが、常にエラー メッセージが表示されます。
変数ではないため、'System.Collections.Generic.List.this[int]' の戻り値を変更できません
なにが問題ですか?値を変更するにはどうすればよいですか?
struct AccountContainer
{
public string Name;
public int Age;
public int Children;
public int Money;
public AccountContainer(string name, int age, int children, int money)
: this()
{
this.Name = name;
this.Age = age;
this.Children = children;
this.Money = money;
}
}
List<AccountContainer> AccountList = new List<AccountContainer>();
AccountList.Add(new AccountContainer("Michael", 54, 3, 512913));
AccountList[0].Money = 547885;