list<t> to array</t>
-
How to sort array values. but sot\rting parameters are in list.what do do? for example in below code i want sort the values. what shall i do? shall you help me for this sorting process? private struct Xsweep { public double X; public double Y; public int cI; public int pI; public int nI; public int n; } List Poly = new List(); List X = new List(); n = Poly.Count - 1; for (int i = 0; i <= n; i++) { if(i < X.Count) X[i] = Poly[i].X; else X.Add(Poly[i].X); } Array.Sort(X, Poly);
-
How to sort array values. but sot\rting parameters are in list.what do do? for example in below code i want sort the values. what shall i do? shall you help me for this sorting process? private struct Xsweep { public double X; public double Y; public int cI; public int pI; public int nI; public int n; } List Poly = new List(); List X = new List(); n = Poly.Count - 1; for (int i = 0; i <= n; i++) { if(i < X.Count) X[i] = Poly[i].X; else X.Add(Poly[i].X); } Array.Sort(X, Poly);
-
How to sort array values. but sot\rting parameters are in list.what do do? for example in below code i want sort the values. what shall i do? shall you help me for this sorting process? private struct Xsweep { public double X; public double Y; public int cI; public int pI; public int nI; public int n; } List Poly = new List(); List X = new List(); n = Poly.Count - 1; for (int i = 0; i <= n; i++) { if(i < X.Count) X[i] = Poly[i].X; else X.Add(Poly[i].X); } Array.Sort(X, Poly);
cst_kvp wrote:
List Poly = new List(); List X = new List(); n = Poly.Count - 1;
:confused: What is this ? You have not added anything to your list
poly
, how can you iterate the items then ?All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions
-
How to sort array values. but sot\rting parameters are in list.what do do? for example in below code i want sort the values. what shall i do? shall you help me for this sorting process? private struct Xsweep { public double X; public double Y; public int cI; public int pI; public int nI; public int n; } List Poly = new List(); List X = new List(); n = Poly.Count - 1; for (int i = 0; i <= n; i++) { if(i < X.Count) X[i] = Poly[i].X; else X.Add(Poly[i].X); } Array.Sort(X, Poly);
Hi, Did you look at the built in sortable list types ?
Those who want most to speak up, are often those who have nothing clever to say.
-
How to sort array values. but sot\rting parameters are in list.what do do? for example in below code i want sort the values. what shall i do? shall you help me for this sorting process? private struct Xsweep { public double X; public double Y; public int cI; public int pI; public int nI; public int n; } List Poly = new List(); List X = new List(); n = Poly.Count - 1; for (int i = 0; i <= n; i++) { if(i < X.Count) X[i] = Poly[i].X; else X.Add(Poly[i].X); } Array.Sort(X, Poly);
there is no logic at all in ur code. First read some books related to arrays and then try to code it.
SSK. Anyone who says sunshine brings happiness has never danced in the rain.