我有一個結構數組,其中有一個名爲total的數據項。我想根據整數數據項'total'對這個數組進行排序。根據結構數組c中的值排序#
struct Disease
{
public int male;
public int female;
public int total=0;
public string diseaseName;
}
Disease [] opDisease = new Disease [21];
opDisease[0].total= somevalue1;
opDisease[1].total= somevalue2;
...
...
...
...
I want to sort opDisease array based on the value of 'total'.
thank you!
。 ... 你試過什麼了? –