我不斷收到上述警告ordersubmitted
和lastfillquantity
,但一切似乎工作正常,當我打印他們似乎正確更新的變量。永遠不會分配給,並將始終有其默認值0
public partial class Form1 : Form
{
private bool ordersubmitted = false;
private int lastfillquantity;
private void SubmitOrder()
{
int lastfillquantity = e.filled;
ordersubmitted = true
}
}
的可能的複製[現場XXX永遠不會分配給,永遠有它的默認值零(http://stackoverflow.com/questions/4811155/field-xxx-is -never-assigned-to-and-will-always-have-its-default-value-null) – CompuChip