private bool[] if_checkbox_enabled()
{
bool[] rst = new bool[5];
rst[0] = (bool)a.IsChecked;
rst[1] = (bool)b.IsChecked;
rst[2] = (bool)c.IsChecked;
rst[3] = (bool)d.IsChecked;
rst[4] = (bool)e.IsChecked;
return rst;
}
correct case:
bool[] result = { false, false, false, false, false };
if (if_checkbox_enabled() == result)//no problem
{...}
wrong case:
if (if_checkbox_enabled() == { false, false, false, false, false })//reports error
{...}
Why can't I directly use a bool type array for the judgement statement? Thanks!